コード例 #1
0
ファイル: Enemy.cs プロジェクト: PaulIndrome/Runestone-Dash
    //set up all necessary attributes and apply the effects to yourself
    public void SetupEnemy(EnemyType et, EnemyCurvePath ecp)
    {
        enemyType      = et;
        enemyCurvePath = ecp;

        enemyHealth = GetComponent <EnemyHealth>();
        enemyHealth.SetupHealth(enemyType);
        enemyShieldCollision = GetComponentInChildren <EnemyShieldCollision>();

        foreach (EnemyEffect e in enemyType.enemyEffects)
        {
            e.Apply(this);
        }

        canMove = true;
        //interestingly, ScriptableObjects can contain the definition for coroutines and
        //run them on an external MonoBehaviour, which is what happens here
        StartCoroutine(enemyCurvePath.MoveTowardsTarget(this));
    }
コード例 #2
0
 public void Start()
 {
     enemyAudioSource     = GetComponent <AudioSource>();
     enemy                = GetComponent <Enemy>();
     enemyShieldCollision = GetComponentInChildren <EnemyShieldCollision>();
 }