Container.GetGameObjectAt C# (CSharp) Method

GetGameObjectAt() public method

public GetGameObjectAt ( int index ) : GameObject
index int
return GameObject
    public GameObject GetGameObjectAt(int index)
    {
        if (GetItemAt(index)!="")
        {
            return GameObject.Find (GetItemAt (index));
        }
        else
        {
            return null;
        }
    }

Usage Example

 public static void SetItemsParent(Container cn, Transform Parent)
 {
     for (short i = 0; i <= cn.MaxCapacity(); i++)
     {
         string ItemName = cn.GetItemAt(i);
         if (ItemName != "")
         {
             GameObject item = cn.GetGameObjectAt(i);                 //GameObject.Find (cn.GetItemAt(i));
             if (item != null)
             {
                 item.transform.parent = Parent;
                 if (Parent == GameWorldController.instance.LevelMarker())
                 {
                     GameWorldController.MoveToWorld(item);
                 }
                 else
                 {
                     GameWorldController.MoveToInventory(item);
                 }
                 if (item.GetComponent <Container>() != null)
                 {
                     Container.SetItemsParent(item.GetComponent <Container>(), Parent);
                 }
             }
         }
     }
 }
All Usage Examples Of Container::GetGameObjectAt