コード例 #1
0
    public void DeflectPerfeclty(float multiplier)
    {
        // Starts as random
        SetStartingDeflectionState();

        // If the enemy was killed in the process...we try to get another enemy, if it is the last one we make it look like random
        SetTarget(enemyBulletOwner);
        if (target == null)
        {
            AI_Master AI = FindObjectOfType <AI_Master>();
            if (AI != null)
            {
                Transform newEnemy = AI.GetClosestEnemy(transform.position);
                if (newEnemy != null)
                {
                    SetTarget(newEnemy);
                }
            }
        }
        ;

        if (target == null)
        {
            SetRandomDirection();
            Instantiate(particlesWhenBouncedRandomly, transform.position, transform.rotation);
            return;
        }

        SetPerfectDirection(multiplier);
        ChangeColor();
        Instantiate(particlesWhenBouncedPerfectly, transform.position, transform.rotation);
        AUD_Manager.SetSwitch("Parry", "Success", gameObject);
        AUD_Manager.PostEvent("PC_Perry_ST", gameObject);
        bouncedPerfectly = true;
    }
コード例 #2
0
    private void Awake()
    {
        mHealth = mBase.mMaxHealth;

        rBody = GetComponent <Rigidbody>();

        mGun = GetComponentInChildren <WP_Gun>();

        mMaster = FindObjectOfType <AI_Master>();
        mMaster.mNPCList.Add(this);

        mMover = GetComponent <AI_Mover>();

        mState       = STATE.COMBAT;
        mStateChange = STATE.COMBAT;

        mOrienter = GetComponent <AI_Orienter>();

        mPlayersCam = Camera.main;

        mMoveToGoal = GetComponent <AI_MoveToGoal>();
    }
コード例 #3
0
    }//end OnDisable()

    private void SetInitReferences()
    {
        AIManagerMaster     = this.GetComponent <AI_Master>();
        playerManagerMaster = GameObject.Find("Player").GetComponent <PM_Master>();
    }//end setInitReferences()
コード例 #4
0
 private void Awake()
 {
     mPushObjs = FindObjectsOfType <LVL_PushObj>();
     mMaster   = GetComponent <AI_Controller>().mMaster;
 }
コード例 #5
0
    }//end OnDisable()

    private void SetInitReferences()
    {
        AIManagerMaster = GameObject.Find("Enemy_EvilPlayer").GetComponent <AI_Master>();
    }//end setInitReferences()