コード例 #1
0
 private void Start()
 {
     Move();
     InitManoeuvre();
     InvokeRepeating("Fire", m_Delay, m_FireRate);
     m_Boundary = m_Data.GetBoundary();
 }
コード例 #2
0
    void Start()
    {
        agent        = transform.gameObject.GetComponentInParent <SpaceShooterNavigatorAgent>();
        weaponsAgent = GetComponentInChildren <SpaceShooterWeaponsAgent>();

        boundaryLocal = boundary;
        if (agent != null)
        {
            boundaryLocal.xMin = boundary.xMin + agent.transform.position.x;
            boundaryLocal.xMax = boundary.xMax + agent.transform.position.x;
            boundaryLocal.zMin = boundary.zMin + agent.transform.position.z;
            boundaryLocal.zMax = boundary.zMax + agent.transform.position.z;
        }
        if (weaponsAgent != null)
        {
            //Debug.Log(gameObject.name + "has weapons agent!");
            GameObject go = GameObject.Find("SpaceShooterBrain");
            if (go != null)
            {
                //Debug.Log("Found SpaceShooterBrain!");
                weaponsAgent.GiveBrain(go.GetComponentInChildren <Brain>());
                //Debug.Log("Assigned brain to player.");
            }
        }
    }