Example #1
0
    void Awake()
    {
        //droids = this.GetComponentsInChildren<AutoHumanoidAgentController>();
        //drones = this.GetComponentsInChildren<AutoDroneController>();
        spawnPoints    = FindObjectsOfType <SpawnPoint>();
        m_mobilePlayer = FindObjectOfType <PlayerControllerMobile>();

        //foreach (var droid in droids)
        //{
        //    droid.addOnDestroyEvent(OnAgentDestory);
        //}

        //foreach (var drone in drones)
        //{
        //    drone.addOnDestroyEvent(OnAgentDestory);
        //}
    }
    void Awake()
    {
        controller        = GetComponent <PlayerControllerMobile>();
        anim              = GetComponent <Animator>();
        sheild            = this.gameObject.transform.GetChild(0).gameObject;
        rigidbody2D       = GetComponent <Rigidbody2D>();
        coinCollectedText = GameObject.FindGameObjectWithTag("coin_collected_text") as GameObject;

        isStanding = true;
        isAlive    = true;
        isGameOver = false;
        isSoundOn  = GamePreferences.GetSoundSetting() == 1 ? true : false;
        DeactivateSheild();
        score = 0;

        boundaryRight = (CameraProperties.GetCameraWidth(Camera.main) / 2) - 1f;
        boundaryLeft  = -boundaryRight;
        boundaryUp    = CameraProperties.GetCameraHeight(Camera.main) / 2 - 0.7f;
    }    // awake