private void Awake() { eInputMode = EInputMode.FREEMOVEMENT; eState = EState.NORMAL; m_Rigidbody2D = GetComponent <Rigidbody2D>(); cPlayerInput = this.GetComponent <CPlayerInput>(); }
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; }
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; }
public static void SetInputMode(EInputMode inputMode) { switch (inputMode) { case EInputMode.Game: Cursor.visible = false; break; case EInputMode.UI: Cursor.visible = true; break; } }
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; } }
/// <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; } }
public static void SetInputMode(EInputMode mode) { CheckError(SetConsoleMode(m_StdInputHandle, (uint)mode)); }
public void SetInputMode(EInputMode newMode) { InputMode = newMode; }
private void OnFinishDialogue() { eInputMode = EInputMode.FREEMOVEMENT; m_Rigidbody2D.bodyType = RigidbodyType2D.Dynamic; }