コード例 #1
0
 void OnAirshipTrigger()
 {
     if (m_pingPongFlag)
     {
         CEntityAirship.GetInstance().StartCutScene();
         CEntityCaptain.GetInstance().StartCutScene();
     }
 }
コード例 #2
0
    // Called once the cutscene has ended
    void OnCutSceneEnd()
    {
        if (!m_pingPongFlag)
        {
            if (GruntObject != null)
            {
                CEntityGrunt grunt = GruntObject.GetComponent <CEntityGrunt>();
                if (grunt != null)
                {
                    grunt.SetGruntState(GruntState.Walking);
                }
            }

            if (m_camera == null)
            {
                Debug.LogError("Camera is null on a cutscene: " + name);
            }

            m_camera.ResetLookAtTransform();
            m_player.SetPlayerState(PlayerState.Standing);
            m_camera.DistanceFromPlayer = m_initialDistanceFromPlayer;
            m_camera.MaxPositionsStored = m_maxPositionsStored;
            m_active = false;
            enabled  = false;
            GameObject.Destroy(this.gameObject);

            if (this.gameObject.name == "AirshipTriggerStart")
            {
                m_hasSeenAirshipCutscene = true;
            }

            //only occurs if airship cutscene
            if (CEntityAirship.GetInstance())
            {
                CEntityAirship.GetInstance().EndCutScene();
            }
            if (CEntityCaptain.GetInstance())
            {
                CEntityCaptain.GetInstance().EndCutScene();
            }
        }
    }
 void OnTriggerEnter(Collider collider)
 {
     if(!m_airship)
     {
         m_airship = CEntityAirship.GetInstance();
     }
     if(EnableAirship)
     {
         m_airship.gameObject.SetActiveRecursively(true);
         //m_airship.StartCutScene();
         CEntityCaptain captain = CEntityCaptain.GetInstance();
         if (captain != null) {
             captain.StartCutScene();
         }
     }
     else
     {
         m_airship.gameObject.SetActiveRecursively(false);
     }
 }
コード例 #4
0
 void OnTriggerEnter(Collider collider)
 {
     if (!m_airship)
     {
         m_airship = CEntityAirship.GetInstance();
     }
     if (EnableAirship)
     {
         m_airship.gameObject.SetActiveRecursively(true);
         //m_airship.StartCutScene();
         CEntityCaptain captain = CEntityCaptain.GetInstance();
         if (captain != null)
         {
             captain.StartCutScene();
         }
     }
     else
     {
         m_airship.gameObject.SetActiveRecursively(false);
     }
 }
    // Use this for initialization
    void Start()
    {
        INSTANCE           = this;
        m_initialTransform = this.transform;

        m_storedYPositions = new ArrayList();

        m_fireTimer = 0.0f;
        m_isFiring  = false;
        testLength  = 0.0f;

        m_playerEntity = CEntityPlayer.GetInstance();
        if (m_playerEntity == null)
        {
            GameObject playerObject = GameObject.Find("Player Spawn");
            if (playerObject != null)
            {
                m_playerEntity = playerObject.GetComponent <CEntityPlayer>();
            }
            if (m_playerEntity == null)
            {
                Debug.LogError("CEntityAirship: Cannot find player");
                return;
            }
        }

        m_playerTransform = m_playerEntity.transform.FindChild("Player_Mesh/Bip001/Bip001 Pelvis");

        float playerY = m_playerTransform.position.y;

        for (int posCount = 0; posCount < NumYPositions; posCount++)
        {
            m_storedYPositions.Add(playerY);
        }
        this.gameObject.SetActiveRecursively(false);
    }
    // Use this for initialization
    void Start()
    {
        INSTANCE = this;
        m_initialTransform = this.transform;

        m_storedYPositions = new ArrayList();

        m_fireTimer = 0.0f;
        m_isFiring = false;
        testLength = 0.0f;

        m_playerEntity = CEntityPlayer.GetInstance();
        if (m_playerEntity == null) {
            GameObject playerObject = GameObject.Find("Player Spawn");
            if (playerObject != null) {
                m_playerEntity = playerObject.GetComponent<CEntityPlayer>();
            }
            if (m_playerEntity == null) {
                Debug.LogError("CEntityAirship: Cannot find player");
                return;
            }
        }

        m_playerTransform = m_playerEntity.transform.FindChild("Player_Mesh/Bip001/Bip001 Pelvis");

        float playerY = m_playerTransform.position.y;
        for( int posCount = 0; posCount < NumYPositions; posCount++ )
        {
            m_storedYPositions.Add(playerY);
        }
        this.gameObject.SetActiveRecursively(false);
    }