Пример #1
0
    void  Update()
    {
        if (crosable == false)
        {
            reachable = false;
        }
        if (askedUpdate)
        {
            updateColor();
            askedUpdate = false;
        }
        playerOnIt = detectPlayer();
        if (playerOnIt != null)
        {
            playerControler temp;

            try
            {
                temp = playerOnIt.GetComponent <playerControler>();
                temp.updateCell(this.gameObject);
            }
            catch (System.Exception)
            {
                OtherPlayerControler temp2 = playerOnIt.GetComponent <OtherPlayerControler>();
                temp2.updateCell(this.gameObject);
            }
        }
    }