Пример #1
0
    /*
     * \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 = "Grunt";

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

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

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

        m_playerHealth = MaxHealth;

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

        m_physics.MovingDirection = StartFacing == LeftRight.Left ? 1 : -1;

        m_playerState = GruntState.Walking;

        m_dead.didDie = false;


        m_debug = GetComponent <CGruntDebug>();
        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();

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

        //Time.timeScale = 0.75f;

        m_playerPositionAlpha = InitialAlphaPosition;
        m_name = "Grunt";

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

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

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

        m_playerHealth = MaxHealth;

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

        m_physics.MovingDirection = StartFacing == LeftRight.Left ? 1 : -1;

        m_playerState = GruntState.Walking;

        m_dead.didDie = false;

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