void Update() { //GameplaySystem.MovementTdelta(transform, moveSpeed); //GameplaySystem.PhysicsMovement(rb2D, moveSpeed, maxVelX); GameplaySystem.PhysicsMovementVel(rb2D, moveSpeed, maxVelX); spr.flipX = Flip; }
public override void Move() { if (!isNpc) { GameplaySystem.MovementTopdown(rb2D.transform, moveSpeed); moving = GameplaySystem.AxisTopdown != Vector2.zero; if (moving) { //animaciones anim.SetFloat("moveX", GameplaySystem.AxisTopdown.x); anim.SetFloat("moveY", GameplaySystem.AxisTopdown.y); spr.flipX = FlipSprite; } //animator //Sprite renderer anim.SetBool("moving", moving); } else { base.Move(); } }
void Update() { if (!isNpc && !GameManager.instance.Win) { GameplaySystem.Movement3D(transform, moveSpeed); moving = GameplaySystem.Axis3D != Vector3.zero; anim.SetBool("moving", moving && !GameManager.instance.isShooting); if (GameplaySystem.Axis3D != Vector3.zero && moveSpeed != 0) { transform.rotation = Quaternion.LookRotation(GameplaySystem.Axis3D.normalized); } if (GameplaySystem.JumpBtn) { Shot(); } } else { base.Move(); for (int i = 1; GameManager.instance.party.CurrentParty.Count > i; i++) { if (this.currentHealth < maxHealth) { StartCoroutine(WaitForPassiveHeal()); } GameManager.instance.party.CurrentParty[i].navMeshAgent.destination = GameManager.instance.party.CurrentParty[i - 1].transform.position; } } }
private void Update() { if (Input.GetButtonDown("PickUp")) { if (!carrying) { pickedGameObject = GameplaySystem.PickUp(this.gameObject, maxDistance, foodLayer, pickUpPosition.position); carrying = pickedGameObject != null; } else { SoundManager.instance.ThrowFood(); anim.SetTrigger("Throw"); if (Physics.Raycast(transform.position, transform.forward, out hit, 1000, tablesLayer)) { Vector3 table = hit.transform.position + new Vector3(0, desfaseY, 0); StartCoroutine(GameManager.instance.MoveToPoint(pickedGameObject, table, throwForce)); hit.collider.gameObject.GetComponent <Table>().ServeFood(pickedGameObject.GetComponent <Food>().Points); carrying = false; pickedGameObject.transform.parent = null; pickedGameObject = null; } else { GameplaySystem.Throw(transform, pickedGameObject, throwForce); StartCoroutine(GameManager.instance.FadeOut(pickedGameObject)); carrying = false; pickedGameObject = null; } } } }
void Update() { GameplaySystem.CheckDistance(transform, target, chaseRadius, moveSpeed); if (GameObject.FindWithTag("Player") != null) { target = GameObject.FindWithTag("Player").transform; } }
private void Awake() { // Setting up references. m_GroundCheck = transform.Find("GroundCheck"); m_CeilingCheck = transform.Find("CeilingCheck"); m_Anim = GetComponent <Animator>(); m_Rigidbody2D = GetComponent <Rigidbody2D>(); m_GameplaySys = GameObject.FindObjectOfType <GameplaySystem> (); }
// Animator anim; // SpriteRenderer sprite; void Update() { if (transform.gameObject != null) { Move(); } if (GameplaySystem.JumpBtn && !jump) { scale = 90.0f; GameplaySystem.JumpTopdown(transform, scale); jump = true; scale = 75.0f; StartCoroutine(JumpTime()); } }
void FixedUpdate() { if (GameplaySystem.JumpBtn) { if (Grounding) { anim.SetTrigger("jump"); GameplaySystem.Jump(rb2D, jumpForce); } } anim.SetBool("grounding", Grounding); //GameplaySystem.MovementAddForce(rb2D, moveSpeed, maxVel, Grounding); GameplaySystem.MovementVelocity(rb2D, moveSpeed, maxVel); }
void FixedUpdate() { if (GameplaySystem.JumpBtn) { if (Grounding) { GameManager.instance.GameData.PlayerPos = transform.position; //Debug.Log(Gamemanager.instance.gameData.Player); GameManager.instance.Save(); anim.SetTrigger("jump"); GameplaySystem.Jump(rb2D, jumpForce); } } anim.SetBool("grounding", Grounding); GameplaySystem.MovementVelocity(rb2D, moveSpeed, maxVel); }
void FixedUpdate() { if (GameplaySystem.JumpBtn) { if (Grounding) { // anim.SetTrigger("jump"); GameplaySystem.Jump(rb2D, jumpForce); doubleJump = true; } else if (!Grounding && doubleJump) { // anim.SetTrigger("jump2"); GameplaySystem.Jump(rb2D, (jumpForce * 0.8f)); doubleJump = false; } } anim.SetBool("grounding", Grounding); }
private void Awake() { m_GameplaySys = GameObject.FindObjectOfType <GameplaySystem> (); }
public KeyLineCommand(GameplaySystem gameplay, HitObjectContainer hitObjectContainer, int line) { Line = line; _hitObjectContainer = hitObjectContainer; _gameplay = gameplay; }
void Update() { GameplaySystem.TMovementDelta(transform, moveSpeed); }
void FixedUpdate() { GameplaySystem.MoveTopdown3D(transform, moveSpeed); }