Example #1
0
    public void Start()
    {
        animator    = this.GetComponent <Animator>();
        canAttack   = true;
        isAttacking = false;
        gHealth     = Health;
        BarHealth.SetPercent(gHealth / Health);
        gCharisma      = 0;
        lastSpeachTime = float.MaxValue;
        if (BarCharisma != null)
        {
            BarCharisma.SetPercent(gCharisma / Charisma);
        }
        gSpeed = Speed;
        // No gravity in our sim
        RigidBody.gravityScale = 0;

        // If we aren't a castle, we must freeze rot
        if (TroopType != ArmyManager.Troop.Castle)
        {
            RigidBody.freezeRotation = true;
        }
    }