コード例 #1
0
    protected void StartBegin()
    {
        anim      = GetComponent <Animator>();
        playerObj = FindObjectOfType <SpaceShipMove>();
        enemyRB   = GetComponent <Rigidbody>();

        enemyBattleAI = GetComponent <EnemyShipBattleAI>();

        myHealth             = GetComponent <Damagable>();
        myHealth.enemyChHlth = OnHealthChange;
        myHealth.deathDel    = OnDeath;

        LPP       = FindObjectOfType <ListPathPoints>();
        waypoints = LPP.GetPath(indexOfPath);

        waypointsCoord = new List <Vector3>();
        foreach (Transform tr in waypoints)
        {
            waypointsCoord.Add(tr.position);
        }

        currWayIndex         = 0;
        currWayPoint         = waypointsCoord[currWayIndex];
        addedWayIndex        = -1;
        increment            = 1;
        isUnderAttack        = false;
        obstacleRunawayState = false;
    }
コード例 #2
0
ファイル: PlatformAI.cs プロジェクト: RadFam/SpaceHunter
    // Start is called before the first frame update
    void Start()
    {
        fixedLeftCannonPos  = leftCannon.transform.localPosition;
        fixedRightCannonPos = rightCannon.transform.localPosition;

        anim          = gameObject.GetComponent <Animator>();
        enemyBattleAI = gameObject.GetComponent <EnemyShipBattleAI>();

        Damagable myHealth = GetComponent <Damagable>();

        myHealth.enemyChHlth = OnHealthChange;
        myHealth.deathDel    = OnMyDeath;

        timer = timeToLookForPlayer;
    }