Exemplo n.º 1
0
 public DefenceSM(NavMeshAgent ag, FiniStateMachine st, KitchenHelper hp, STATUS _status, stateType stateTYPE, Animator an) : base(ag, st, hp, _status, stateTYPE, an)
 {
     chasingDistance = status.getCurrentweapon.chasingdistance;
     attackingTime   = status.getCurrentweapon.attackdelay;
     attackRange     = status.getCurrentweapon.attackrange;
     attacktimer     = attackingTime;
 }
Exemplo n.º 2
0
    public override void OnTriggerEnter(Collider other)
    {
        if (other.tag == StaticStrings.helper || other.tag == StaticStrings.player ||
            other.tag == StaticStrings.tower)
        {
            rb        = other.GetComponent <Rigidbody>();
            enemyteam = other.GetComponent <ITeam>().getTeam();

            if (enemyteam != tm)
            {
                IHealth h = other.GetComponent <IHealth>();
                h.takeDamage(damage);
                EffectDirector.instance.playInPlace(transform.position, StaticStrings.tornado);
                if (rb == null)
                {
                    return;
                }
                rb.AddForce(new Vector3(200, 800, 800));
                Invoke("stop", 5);
            }
            else
            {
                FiniStateMachine SM = other.GetComponent <FiniStateMachine>();
                if (SM)
                {
                    SM.becomeInvincible(true);
                }
            }
            if (Soundmanager.instance == null)
            {
                return;
            }
            Soundmanager.instance.PlaySeByName(StaticStrings.wind);
        }
    }
Exemplo n.º 3
0
 public AIState(NavMeshAgent ag, FiniStateMachine st, KitchenHelper hp, STATUS _status, stateType stateTYPE, Animator an)
 {
     stateMachine = st;
     agent        = ag;
     helper       = hp;
     status       = _status;
     stateType    = stateTYPE;
     anim         = an;
 }
Exemplo n.º 4
0
    private void ripristing()
    {
        if (objectToFreez != null)
        {
            objectToFreez.SetActive(true);
        }
        FiniStateMachine sm = objectToFreez.GetComponent <FiniStateMachine>();

        if (sm != null)
        {
            sm.changeState(stateType.cake);
        }
        Destroy(this.gameObject);
    }
Exemplo n.º 5
0
 public AttackSM(NavMeshAgent ag, FiniStateMachine st, KitchenHelper hp, STATUS _status, stateType stateTYPE, Animator an) : base(ag, st, hp, _status, stateTYPE, an)
 {
     attackingTime = status.getCurrentweapon.attackdelay;
     attacktimer   = attackingTime;
 }
Exemplo n.º 6
0
 public IdleSM(NavMeshAgent ag, FiniStateMachine st, KitchenHelper hp, STATUS _status, stateType stateTYPE, Animator an) : base(ag, st, hp, _status, stateTYPE, an)
 {
 }
 public MakeCakeSM(NavMeshAgent ag, FiniStateMachine st, KitchenHelper hp, STATUS _status, stateType stateTYPE, Animator an) : base(ag, st, hp, _status, stateTYPE, an)
 {
     helper.onReciveMaterial += OnReciveMaterial;
     pettingrange             = status.pettingrange;
 }