示例#1
0
 public virtual void Recycle()
 {
     health.setHealth(health.maxHealth);
     State = MinionStates.Move;
     GetComponent <Rigidbody>().constraints = RigidbodyConstraints.FreezeRotationX
                                              | RigidbodyConstraints.FreezeRotationZ;
     GetComponent <NavMeshAgent>().enabled = true;
 }
示例#2
0
    // Start is called before the first frame update
    protected virtual void Start()
    {
        health = GetComponent <HealthBehavior>();
        health.setHealth(maxHealth);

        shooter = GetComponent <MinionShootController>();

        anim = GetComponent <Animator>();

        leftRight = getAxisString(true);
        upDown    = getAxisString(false);
        altHalt   = getAltHalt();


        // Set base information
        if (P1_Base == null)
        {
            P1_Base = GameObject.FindWithTag("P1_Base");
        }

        if (P2_Base == null)
        {
            P2_Base = GameObject.FindWithTag("P2_Base");
        }

        Assert.IsTrue(taggyboi.isMinion(tag),
                      "Minion tag " + tag + " improperly set");

        homeBase  = (taggyboi.isP1Tag(tag) ? P1_Base.transform : P2_Base.transform);
        enemyBase = (taggyboi.isP1Tag(tag) ? P2_Base.transform : P1_Base.transform);


        // Start them off by standing still until they get an order.
        moveType = lastType = MinionMoveTypes.Halt;
        // Both Soldiers and Teddies are allowed to start moving immediately
        State = MinionStates.Move;

        StartCoroutine(TargetSearch());

        if (debugOnce)
        {
            //StartCoroutine(PrintStates());
            //StartCoroutine(PrintDpad());
            debugOnce = false;
        }
    }