Пример #1
0
    void Awake()
    {
                #if UNITY_ANDROID
        TouchControl.UpdatePlayerObject(this);
                #endif

        // Messenger<GameObject>.Broadcast("FillPlayerGO", gameObject);
        // lvlInfoDisplay = GameObject.Find("LevelInfo");

        // normalMat = Resources.Load("Materials/PlayerTile") as Material;
        // boostMat = Resources.Load("Materials/PlayerBoostTile") as Material;
        // regainMat = Resources.Load("Materials/PlayerNoBoostTile") as Material;

        // gameObject.AddComponent<MatOffset>();

        // GetComponent<SpriteRenderer>().enabled = false;

        if (playerGraphicsGO)
        {
            graphicsGO = Instantiate(playerGraphicsGO, transform.position, transform.rotation) as GameObject;
            graphicsGO.transform.SetParent(transform);

            graphicsGO.transform.localScale = Vector2.one;
        }

        levelCompletePS = GameObject.Find("LevelCompletePS").GetComponent <LevelCompletePS>();
        // Debug.Log("Here");

        collider = GetComponent <Collider2D>();
    }