예제 #1
0
 void Update()
 {
     //GameplaySystem.MovementTdelta(transform, moveSpeed);
     //GameplaySystem.PhysicsMovement(rb2D, moveSpeed, maxVelX);
     GameplaySystem.PhysicsMovementVel(rb2D, moveSpeed, maxVelX);
     spr.flipX = Flip;
 }
예제 #2
0
    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();
        }
    }
예제 #3
0
    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;
            }
        }
    }
예제 #4
0
 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;
             }
         }
     }
 }
예제 #5
0
 void Update()
 {
     GameplaySystem.CheckDistance(transform, target, chaseRadius, moveSpeed);
     if (GameObject.FindWithTag("Player") != null)
     {
         target = GameObject.FindWithTag("Player").transform;
     }
 }
예제 #6
0
 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> ();
 }
예제 #7
0
    // 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());
        }
    }
예제 #8
0
    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);
    }
예제 #9
0
 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);
 }
예제 #10
0
 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);
 }
예제 #11
0
 private void Awake()
 {
     m_GameplaySys = GameObject.FindObjectOfType <GameplaySystem> ();
 }
예제 #12
0
 public KeyLineCommand(GameplaySystem gameplay, HitObjectContainer hitObjectContainer, int line)
 {
     Line = line;
     _hitObjectContainer = hitObjectContainer;
     _gameplay           = gameplay;
 }
예제 #13
0
 void Update()
 {
     GameplaySystem.TMovementDelta(transform, moveSpeed);
 }
예제 #14
0
 void FixedUpdate()
 {
     GameplaySystem.MoveTopdown3D(transform, moveSpeed);
 }