Пример #1
0
    public void Init(UNITFACTION f)
    {
        faction = f;

        switch (faction)
        {
        case UNITFACTION.PLAYER:
            joysticks = managerGame.controlJoysticks;
            break;

        case UNITFACTION.ENEMY:
            agent.isStopped = false;
            break;
        }

        controller.detectCollisions = rb.detectCollisions = true;

        //Set statsUI behaviour.
        statsUI.tTarget = transform;
        statsUI.Init(faction);

        //Stats
        hpCurrent = hpBase;
        UpdateUI_HP();

        isActive = true;
    }