Search Unity

!IsActive && !GetRunInEditMode error.

Discussion in 'Scripting' started by Rutenis, Nov 22, 2014.

  1. Rutenis

    Rutenis

    Joined:
    Aug 7, 2013
    Posts:
    297
    Hey, so whenever i touch a texture, i get this error, even tho everything works perfectly fine. What should i do?

    Code:
    Code (csharp):
    1.  
    2.  
    3.                     foreach (Touch touch in Input.touches)
    4.                     {  
    5.                         Vector3 inputGuiPosition = touch.position;
    6.                         inputGuiPosition.y = Screen.height - inputGuiPosition.y;
    7.  
    8.                         if(Input.touchCount > 0)
    9.                         {
    10.                             if (Event.current.type == Event.inputGuiPosition)
    11.                             {
    12.                                 if(slotRect.Contains(inputGuiPosition))
    13.                                 {
    14.                                     ItemRec(slots[i]);
    15.                                     //Debug.Log(currentItemId);
    16.                                     if(currentItemId == 2)
    17.                                     {
    18.                                         MiniGun.SetActive(true);
    19.                                     }
    20.  
    21.                                     if(currentItemId == 3)
    22.                                     {
    23.                                         MachineGun.SetActive (true);
    24.                                     }
    25.                                 }
    26.                             }
    27.                         }
    28.                     }
     
  2. RSG

    RSG

    Joined:
    Feb 20, 2013
    Posts:
    93