示例#1
0
    void Awake()
    {
        soundManager         = FindObjectOfType <SoundManager>();
        crowEnemyAI          = this.gameObject.GetComponent <CrowEnemy_AI>();
        animationComponent   = this.gameObject.transform.GetComponentInChildren <SkeletonEnemy_Animation>();
        pathfindingComponent = this.gameObject.transform.GetComponentInChildren <CrowEnemyAIPathfinding>();

        if (this.gameObject.transform.GetChild(0) != null)
        {
            spriteRenderer = this.gameObject.transform.GetChild(0).GetComponent <SpriteRenderer>();
        }

        waveManager = FindObjectOfType <WaveManager>();
        waveManager.AddActiveEnemy(this.gameObject);
        quirkManager = FindObjectOfType <QuirkManager>();
        playerCount  = FindObjectOfType <PlayerCount>();

        InitialiseClassInstance();

        if (quirkManager.CurrentQuirk.quirkID == 3)
        {
            int chosenModifier = quirkManager.RandomiseMSModifier();
            if (chosenModifier == 0)
            {
                basicEnemyClass.currentMovementSpeed = (basicEnemyClass.currentMovementSpeed / 2);
            }
            if (chosenModifier == 1)
            {
                basicEnemyClass.currentMovementSpeed = (basicEnemyClass.currentMovementSpeed * 2);
            }
        }
    }
 private void Awake()
 {
     aiComponent = this.gameObject.GetComponent <CrowEnemy_AI>();
     seeker      = this.gameObject.GetComponent <Seeker>();
     rigidBody   = this.gameObject.GetComponent <Rigidbody2D>();
     //graphUpdater = FindObjectOfType<GraphUpdateObject>();
 }