Пример #1
0
    // main logic
    public override void Init()
    {
        base.Init();

        // do god mode, if needed)
        if (!godMode)
        {
            MakeVulnerable();
        }
        else
        {
            MakeInvulnerable();
        }

        // start out with no control from the player
        canControl = false;

        // get a ref to the weapon controller
        weaponControl = myGO.GetComponent <Standard_SlotWeaponController> ();

        // if a player manager is not set in the editor, let's try to find one
        if (myPlayerManager == null)
        {
            myPlayerManager = myGO.GetComponent <PlayerManager_Tank> ();
        }

        // set up the data for our player
        myDataManager = myPlayerManager.DataManager_Tank;
        myDataManager.SetName("Player");
        myDataManager.SetHealth(3);
        myDataManager.SetDetaleHealth(100);
        myDataManager.SetProtection(0.5f);

        isFinished = false;

        // get a ref to the player manager
        GameController_Tank.Instance.UpdateLivesP1(myDataManager.GetHealth());
        GameController_Tank.Instance.UpdateLivesDetaleP1(myDataManager.GetDetaleHealth());
    }