Esempio n. 1
0
    protected override void Awake()
    {
        base.Awake();

        _animation = transform.Find("Anim").GetComponent <CPlayerAnimation>();
        _animation.Init(this);
    }
Esempio n. 2
0
    protected override void Awake()
    {
        base.Awake();

        _isMove = false;
        _isLeft = false;

        _animation = GetComponent <CPlayerAnimation>();
        _animation.Init(this);
    }
Esempio n. 3
0
 void Awake()
 {
     this.player          = ReInput.players.GetPlayer(0);
     this._rb             = this.GetComponent <Rigidbody2D>();
     this._needGround     = true;
     this._caughtToObject = false;
     this._onHide         = false;
     _spriteRenderer      = this.transform.GetChild(0).gameObject.GetComponent <SpriteRenderer>();
     _cPlayerAnimation    = this.GetComponent <CPlayerAnimation>();
     onDie = false;
 }
    /*
     * \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);
        }
    }
Esempio n. 6
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));
    }
Esempio n. 7
0
 void Awake()
 {
     _anim = GetComponent <CPlayerAnimation>();
 }
    /*
     * \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);
        }
    }
Esempio n. 10
0
 void Awake()
 {
     _navMeshAgent = GetComponent <NavMeshAgent>();
     _anim         = GetComponent <CPlayerAnimation>();
     _attack       = GetComponent <CPlayerAttack>();
 }
    /*
     * \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));
    }