/*
     * \brief Called when the object is created. At the start.
     *        Only called once per instaniation.
     */
    public override void Start()
    {
        if (INSTANCE == null)
        {
            INSTANCE = this;
        }

        base.Start();

        if (Application.platform == RuntimePlatform.Android)
        {
            Screen.orientation = ScreenOrientation.Landscape;
        }

        //Time.timeScale = 0.75f;

        m_playerPositionAlpha = InitialAlphaPosition;
        m_name = "Player";

        m_physics = GetComponent <CPlayerPhysics>();
        m_physics.Create(this, GetComponent <Rigidbody>());

        //m_cameraClass = MainCamera.GetComponent<CCamera>();

        m_animation = GetComponent <CPlayerAnimation>();
        m_animation.OnStart(GetComponentInChildren <Animation>());

        m_playerHealth = MaxHealth;

        m_characterMesh          = this.transform.Find("Player_Mesh");
        m_characterMesh.rotation = Quaternion.Euler(new Vector3(0, this.transform.rotation.eulerAngles.y + 90, 0));

        m_physics.MovingDirection = StartFacing == LeftRight.Left ? 1 : -1;
        m_ledgeGrabBox            = this.transform.Find("Ledge_Grab_Detection");

        if (StartCheckPoint != null)
        {
            m_lastCheckpoint = StartCheckPoint;
        }

        m_dead.didDie = false;

        m_debug = GetComponent <CPlayerDebug>();
        if (m_debug != null)
        {
            m_debug.SetPlayer(this);
        }

        m_pelvisOffset = this.transform.Find("Player_Mesh/Bip001/Bip001 Pelvis").position - this.transform.position;
    }
    public CCheckPoint StartCheckPoint = null;                          //!< The start point check point


    /*
     * \brief Called when the object is created. At the start.
     *        Only called once per instaniation.
     */
    public override void Start()
    {
        base.Start();

        if (Application.platform == RuntimePlatform.Android)
        {
            Screen.orientation = ScreenOrientation.Landscape;
        }

        //Time.timeScale = 0.75f;

        m_playerPositionAlpha = InitialAlphaPosition;
        m_name = "Player";

        m_physics = GetComponent <CPlayerPhysics>();
        m_physics.Create(this, GetComponent <Rigidbody>());

        m_cameraClass = MainCamera.GetComponent <CCamera>();

        m_animation = GetComponent <CPlayerAnimation>();
        m_animation.OnStart(GetComponentInChildren <Animation>());

        m_playerHealth = MaxHealth;

        m_footSteps = GetComponent <AudioSource>();

        m_characterMesh          = this.transform.Find("Player_Mesh");
        m_characterMesh.rotation = Quaternion.Euler(new Vector3(0, this.transform.rotation.eulerAngles.y + 90, 0));

        m_ledgeGrabBox = this.transform.Find("Ledge_Grab_Detection");

        if (StartCheckPoint != null)
        {
            m_lastCheckpoint = StartCheckPoint;
            m_lastCheckpoint.PlayerCheckPointAlpha = m_playerPositionAlpha;
        }

        m_dead.didDie = false;

        m_debug = GetComponent <CPlayerDebug>();
        if (m_debug != null)
        {
            m_debug.SetPlayer(this);
        }
    }
Beispiel #3
0
    public Camera MainCamera = null;                                    //!< The main viewport camera, which will follow the player


    /*
     * \brief Called when the object is created. At the start.
     *        Only called once per instaniation.
     */
    public override void Start()
    {
        base.Start();

        m_playerPositionAlpha = InitialAlphaPosition;
        m_name = "Player";

        m_physics = GetComponent <CPlayerPhysics>();
        m_physics.Create(GetComponent <Rigidbody>());

        m_cameraClass = MainCamera.GetComponent <CCamera>();

        m_wallJump = GetComponent <CWallJump>();

        m_animation = GetComponent <CPlayerAnimation>();
        m_animation.OnStart(GetComponentInChildren <Animation>());

        m_playerHealth = MaxHealth;

        m_footSteps = GetComponent <AudioSource>();

        this.transform.GetChild(0).transform.rotation = Quaternion.Euler(new Vector3(0, this.transform.rotation.eulerAngles.y + 90, 0));
    }
    /*
     * \brief Called when the object is created. At the start.
     *        Only called once per instaniation.
    */
    public override void Start()
    {
        if (INSTANCE == null) {
            INSTANCE = this;
        }

        base.Start();

        if (Application.platform == RuntimePlatform.Android)
            Screen.orientation = ScreenOrientation.Landscape;

        //Time.timeScale = 0.75f;

        m_playerPositionAlpha = InitialAlphaPosition;
        m_name = "Player";

        m_physics = GetComponent<CPlayerPhysics>();
        m_physics.Create(this, GetComponent<Rigidbody>());

        //m_cameraClass = MainCamera.GetComponent<CCamera>();

        m_animation = GetComponent<CPlayerAnimation>();
        m_animation.OnStart(GetComponentInChildren<Animation>());

        m_playerHealth = MaxHealth;

        m_characterMesh = this.transform.Find("Player_Mesh");
        m_characterMesh.rotation = Quaternion.Euler(new Vector3(0, this.transform.rotation.eulerAngles.y + 90, 0));

        m_physics.MovingDirection = StartFacing == LeftRight.Left ? 1 : -1;
        m_ledgeGrabBox = this.transform.Find("Ledge_Grab_Detection");

        if (StartCheckPoint != null)
        {
            m_lastCheckpoint = StartCheckPoint;
        }

        m_dead.didDie = false;

        m_debug = GetComponent<CPlayerDebug>();
        if (m_debug != null)
        {
            m_debug.SetPlayer(this);
        }

        m_pelvisOffset = this.transform.Find("Player_Mesh/Bip001/Bip001 Pelvis").position - this.transform.position;
    }
    /*
     * \brief Called when the object is created. At the start.
     *        Only called once per instaniation.
    */
    public override void Start()
    {
        base.Start();

        if (Application.platform == RuntimePlatform.Android)
            Screen.orientation = ScreenOrientation.Landscape;

        //Time.timeScale = 0.75f;

        m_playerPositionAlpha = InitialAlphaPosition;
        m_name = "Player";

        m_physics = GetComponent<CPlayerPhysics>();
        m_physics.Create(this, GetComponent<Rigidbody>());

        m_cameraClass = MainCamera.GetComponent<CCamera>();

        m_animation = GetComponent<CPlayerAnimation>();
        m_animation.OnStart(GetComponentInChildren<Animation>());

        m_playerHealth = MaxHealth;

        m_footSteps = GetComponent<AudioSource>();

        m_characterMesh = this.transform.Find("Player_Mesh");
        m_characterMesh.rotation = Quaternion.Euler(new Vector3(0, this.transform.rotation.eulerAngles.y + 90, 0));

        m_ledgeGrabBox = this.transform.Find("Ledge_Grab_Detection");

        if (StartCheckPoint != null)
        {
            m_lastCheckpoint = StartCheckPoint;
            m_lastCheckpoint.PlayerCheckPointAlpha = m_playerPositionAlpha;
        }

        m_dead.didDie = false;

        m_debug = GetComponent<CPlayerDebug>();
        if (m_debug != null)
        {
            m_debug.SetPlayer(this);
        }
    }
    /*
     * \brief Called when the object is created. At the start.
     *        Only called once per instaniation.
    */
    public override void Start()
    {
        base.Start();

        m_playerPositionAlpha = InitialAlphaPosition;
        m_name = "Player";

        m_physics = GetComponent<CPlayerPhysics>();
        m_physics.Create(GetComponent<Rigidbody>());

        m_cameraClass = MainCamera.GetComponent<CCamera>();

        m_wallJump = GetComponent<CWallJump>();

        m_animation = GetComponent<CPlayerAnimation>();
        m_animation.OnStart(GetComponentInChildren<Animation>());

        m_playerHealth = MaxHealth;

        m_footSteps = GetComponent<AudioSource>();

        this.transform.GetChild(0).transform.rotation = Quaternion.Euler(new Vector3(0, this.transform.rotation.eulerAngles.y + 90, 0));
    }