예제 #1
0
    // Start is called before the first frame update
    void Start()
    {
        ui        = FindObjectOfType <InGameUIManager>();
        playerPos = GameObject.FindGameObjectWithTag("Player").transform;

        seek = gameObject.AddComponent <AerialSeek>() as AerialSeek;
        seek.Initialize(this);
        attack = gameObject.AddComponent <BatAttack>() as BatAttack;
        attack.Initialize(this);

        SwitchState(State.SEEK);
    }
예제 #2
0
    // Start is called before the first frame update
    void Awake()
    {
        playerLayer = LayerMask.NameToLayer("Player");
        ui          = FindObjectOfType <InGameUIManager>();

        // TODO make this change to be direction towards player on spawning
        direction = -1;

        seek = gameObject.AddComponent <GroundSeek>() as GroundSeek;
        seek.Initialize(this);
        attack = gameObject.AddComponent <SlideAttack>() as SlideAttack;
        attack.Initialize(this);

        SwitchState(State.SEEK);
    }
예제 #3
0
    void Awake()
    {
        barrel                  = transform.Find("Barrel");
        barrelEnd               = barrel.transform.Find("Visual");
        firingDistRef           = barrel.transform.Find("EndRef");
        firingDistRef.position += (Vector3.left * seekRange);
        playerPos               = GameObject.FindGameObjectWithTag("Player").transform;
        playerLayer             = LayerMask.NameToLayer("Player");
        ui = FindObjectOfType <InGameUIManager>();

        seek = gameObject.AddComponent <TurretSeek>() as TurretSeek;
        seek.Initialize(this);
        attack = gameObject.AddComponent <BaseballAttack>() as BaseballAttack;
        attack.Initialize(this);

        SwitchState(State.SEEK);
    }