void Update()
    {
        if (wasSelected != null)
        {
            Selectable.selected = wasSelected;
        }

        if (checking && Input.GetMouseButtonDown(0))
        {
            Selectable selected = Selectable.selected;
            if (selected != null)
            {
                SnowmanController sc = selected.GetComponent <SnowmanController>();
                if (sc != null)
                {
                    sc.MoveTo(Camera.main.ScreenToWorldPoint(Input.mousePosition));
                }
            }
            checking   = false;
            checkingUp = true;
            clickedLabel.SetActive(false);
        }

        if (checkingUp && Input.GetMouseButtonUp(0))
        {
            checkingUp  = false;
            wasSelected = null;
        }
    }
Exemplo n.º 2
0
    void Start()
    {
        snowmanController = GetComponent <SnowmanController>();
        GameObject enemyStorage = GameObject.Find("FriendlyStorage");

        if (enemyStorage != null)
        {
            enemyLocation = enemyStorage.transform.position;
        }
    }
Exemplo n.º 3
0
 void Awake()
 {
     snowmanController = GetComponent <SnowmanController>();
     selectable        = GetComponent <Selectable>();
 }