Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        EnemyScript.State state = enemyScript.state;
        if (state == EnemyScript.State.ATTACK)
        {
            TargetChar.GetComponent <Animation>().Play(Attack01Anim.name);
        }

        else if (state == EnemyScript.State.IDLE)
        {
            TargetChar.GetComponent <Animation>().Play(Idle.name);
        }

        else if (state == EnemyScript.State.WALK)
        {
            TargetChar.GetComponent <Animation>().Play("walkzombie");
        }
        else if (state == EnemyScript.State.RUN)
        {
            TargetChar.GetComponent <Animation>().Play("runzombie");
        }
        else if (state == EnemyScript.State.DEAD)
        {
            TargetChar.GetComponent <Animation>().Play(DieAnim.name);
        }
    }
Beispiel #2
0
    private void SpawnSodomit(float x, float y, float z, Color color, EnemyScript.State state, int HP, int Point, PlayerScripts player)
    {
        var sodomit = Instantiate(EnemyShip, Vector3.zero, Quaternion.identity)
                      .GetComponent <EnemyScript>();

        sodomit.Init(x, y, z, color, state, HP, Point, player);
    }