Example #1
0
    void Start()
    {
        facingRight = true;
        rigidBody   = GetComponent <Rigidbody2D>();

#if UNITY_ANDROID
        movementTouchPad = GameObject.FindGameObjectWithTag("MovementTouchPad").GetComponent <SimpleTouchPad>();
        touchAreaButton  = GameObject.FindGameObjectWithTag("JumpZone").GetComponent <TouchAreaButton>();
#endif
    }
Example #2
0
 // Use this for initialization
 void Start()
 {
     numPowers         = 0;
     rb                = GetComponent <Rigidbody>();
     shotSpawnRotation = new Quaternion [shotSpawns.Length];
     for (int i = 0; i < shotSpawns.Length; i++)
     {
         shotSpawnRotation[i] = shotSpawns[i].transform.rotation;
     }
     touchpad = GameObject.FindGameObjectWithTag("TouchPad").GetComponent <SimpleTouchPad>();
 }
Example #3
0
    public void InitializePlayer()
    {
        canJump        = false;
        invisibleWalls = false;
        myRb           = gameObject.GetComponent <Rigidbody> ();
        InitializeText();
        //setScore (0);

        mazeInstance = GameObject.FindObjectOfType <Maze>();
        cubeCount    = mazeInstance.cubeCount;
        ShowCubeCount();
        playerMaterial = gameObject.GetComponent <Renderer> ().material;
        //		Debug.Log (playerMaterial);
        stp = GameObject.Find("MovementZone").GetComponent <SimpleTouchPad>();
    }