Пример #1
0
 private void Awake()
 {
     eInputMode    = EInputMode.FREEMOVEMENT;
     eState        = EState.NORMAL;
     m_Rigidbody2D = GetComponent <Rigidbody2D>();
     cPlayerInput  = this.GetComponent <CPlayerInput>();
 }
Пример #2
0
    internal void DisengageToHinge()
    {
        eInputMode = EInputMode.FREEMOVEMENT;

        m_Rigidbody2D.AddForce(new Vector2(0f, m_JumpForce));

        this.GetComponent <HingeJoint2D>().enabled    = false;
        this.GetComponent <DistanceJoint2D>().enabled = false;

        this.GetComponent <HingeJoint2D>().connectedBody    = null;
        this.GetComponent <DistanceJoint2D>().connectedBody = null;
    }
Пример #3
0
    private void AttachToHinge(GameObject gameObject)
    {
        gameObject.GetComponent <Collider2D>().enabled = false;

        this.GetComponent <HingeJoint2D>().connectedBody    = gameObject.GetComponent <Rigidbody2D>();
        this.GetComponent <DistanceJoint2D>().connectedBody = gameObject.transform.parent.transform.GetChild(0).GetComponent <Rigidbody2D>();

        this.GetComponent <HingeJoint2D>().enabled    = true;
        this.GetComponent <DistanceJoint2D>().enabled = true;

        eInputMode = EInputMode.INHINGE;
    }
Пример #4
0
    public static void SetInputMode(EInputMode inputMode)
    {
        switch (inputMode)
        {
        case EInputMode.Game:
            Cursor.visible = false;
            break;

        case EInputMode.UI:
            Cursor.visible = true;
            break;
        }
    }
Пример #5
0
    public static void SetInputMode(EInputMode inputMode, EPauseMode pauseMode)
    {
        SetInputMode(inputMode);

        switch (pauseMode)
        {
        case EPauseMode.Pause:
            Time.timeScale = 0;
            break;

        case EPauseMode.UnPause:
            Time.timeScale = 1;
            break;
        }
    }
Пример #6
0
    /// <summary>
    /// Update is called every frame, if the MonoBehaviour is enabled.
    /// </summary>
    void Update()
    {
        m_OnWater = Physics2D.Raycast(m_CeilingCheck.position, Vector3.down, 1.5f, m_WhatIsWater);
        if (eInputMode == EInputMode.FREEMOVEMENT && m_OnWater)
        {
            cSpiritManager.TemporalyAnchimallenDissapear();
            //cSpiritManager.ChangeSpirit(ESpirit.NONE);
            eInputMode = EInputMode.SWIM;
            ChangeColliderOrientation(false);
        }



        else if (eInputMode == EInputMode.SWIM && !m_OnWater)
        {
            ChangeColliderOrientation(true);
            //m_Rigidbody2D.gravityScale = 3;
            cSpiritManager.ActivateAnchimallen();
            eInputMode = EInputMode.FREEMOVEMENT;
        }
    }
Пример #7
0
 public static void SetInputMode(EInputMode mode)
 {
     CheckError(SetConsoleMode(m_StdInputHandle, (uint)mode));
 }
Пример #8
0
 public void SetInputMode(EInputMode newMode)
 {
     InputMode = newMode;
 }
Пример #9
0
 private void OnFinishDialogue()
 {
     eInputMode             = EInputMode.FREEMOVEMENT;
     m_Rigidbody2D.bodyType = RigidbodyType2D.Dynamic;
 }