- Home /
 
               Question by 
               ahjafri7861 · Jun 27, 2019 at 12:05 PM · 
                gameobjectprefabspritecount  
              
 
              Convert code to get prefab then sprite ?
How to convert this code to get prefab or FPS model rather then a sprite image. i try to write gameobject but it doesn't work ?,how we can convert this code to get PREFAB or FBS model rather then Sprite image.. i try to write gamwobject but it donesn't work ? ............ 
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI;
public class SelectionScript : MonoBehaviour {
 public Image selectionimage;
 public GameObject[] player ;
 //public List<Sprite> Itemlist = new List<Sprite>();
 private int itemspot= 0;
 public void rightselection()
 {
     if (itemspot < player.Count - 1)
     {
         itemspot++;
         selectionimage = player[itemspot];
     }
 }
 public void leftseletion()
 {
     if (itemspot > 0)
     {
         itemspot--;
         selectionimage= player[itemspot];
     }
 }
}
               Comment
              
 
               
              Your answer
 
 
             Follow this Question
Related Questions
Counter for sprite under script from GameObject prefab 0 Answers
Adding a prefab to gameObject at a certain position in runtime 0 Answers
I want get gameobjects except destory obejct in loop. 1 Answer
How can I tell what prefab a GameObject belongs to? 2 Answers
Unity streching sprite gameobject to fit two positions. 1 Answer
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                