Esempio n. 1
0
    /**
     * Starts the script
     */
    void Start()
    {
        // get the player components located around the script
        RigidBody = GetComponent <Rigidbody>();
        Collider  = GetComponent <CapsuleCollider>();

        Debug.Assert(RigidBody);
        Debug.Assert(Collider);

        // get the child player camera
        Camera = GameObject.Find("Camera");
        Debug.Assert(Camera);

        // initialize the player rotations
        m_RotationController.Init(Camera.transform, transform);

        // initialize the animation controller. NOTE if no model was found, the game may run without
        if (!m_AnimationController.Init("Yuna"))
        {
            Debug.Log("No model found for player, the game will run without");
        }

        // initialize the player sounds
        m_SoundController.Init(GetComponentsInChildren <AudioSource>());
    }
Esempio n. 2
0
 // S_Startup
 public static void Startup()
 {
     if (_IsInitialized && !_Controller.IsInitialized)
     {
         _Controller.Init();
         _SoundStarted = _Controller.IsInitialized;
     }
 }
Esempio n. 3
0
 public static void S_Startup()
 {
     if (snd_initialized && !sound_controller.IsInitialized)
     {
         sound_controller.Init();
         sound_started = sound_controller.IsInitialized;
     }
 }
Esempio n. 4
0
    /**
     * Starts the script
     */
    void Start()
    {
        // get the player components located around the script
        RigidBody = GetComponent <Rigidbody>();
        Collider  = GetComponent <CapsuleCollider>();

        Debug.Assert(RigidBody);
        Debug.Assert(Collider);

        // get the child player camera
        Camera = GameObject.Find("CameraCollider");
        Debug.Assert(Camera);

        m_CameraCollider = Camera.GetComponent <WS_CameraCollider>();
        Debug.Assert(m_CameraCollider);
        m_CameraCollider.OnBeforeCheckCollision = OnBeforeCheckCollision;
        m_CameraCollider.OnResolveCollision     = OnResolveCollision;

        // initialize the view status
        m_FirstViewStatus.Init();
        m_ThirdViewStatus.Init(Camera, m_RotationController.m_Head);

        // configure the first person view, if required
        if (m_FirstPerson)
        {
            m_FirstViewStatus.Apply(Camera, m_RotationController.m_Head);
        }

        // initialize the player rotations
        m_RotationController.Init(Camera.transform, transform);

        // initialize the animation controller. NOTE if no model was found, the game may run without
        if (!m_ModelController.Init("Alexandra"))
        {
            if (!m_ModelController.Init("Leonardo"))
            {
                if (!m_ModelController.Init("Sandra"))
                {
                    if (!m_ModelController.Init("William"))
                    {
                        if (!m_ModelController.Init("Yuna"))
                        {
                            if (!m_ModelController.Init("Yan"))
                            {
                                Debug.Log("No model found for player, the game will run without");
                            }
                        }
                    }
                }
            }
        }

        // link the kick animation events
        if (m_ModelController.KickAnimController)
        {
            m_ModelController.KickAnimController.OnKickBall = OnKickBall;
            m_ModelController.KickAnimController.OnKickEnd  = OnKickEnd;
        }

        // initialize the player sounds
        m_SoundController.Init(GetComponentsInChildren <AudioSource>());
    }