Esempio n. 1
0
 void Land()
 {
     _monBody.velocity = Vector2.zero;
     _monAnim.SetBool("IsThrown", false);
     _CurrState = PickaxeState.Grounded;
     _RefParticules.Play(true);
 }
Esempio n. 2
0
    public IEnumerator Trow()
    {
        //Calculate le Angle
        Vector3 leTarget = Camera.main.ScreenToWorldPoint(Input.mousePosition);
        //Its not exactly on le MC and its gonna stay like that
        float DeltaX = leTarget.x - transform.position.x;
        float DeltaY = leTarget.y - transform.position.y;

        Vector2 FinalTarget = new Vector2(DeltaX, DeltaY).normalized;

        _CurrState = PickaxeState.Trown;
        _monAnim.SetBool("IsThrown", true);
        //Random Ass hardcoded number for Speed
        _monBody.AddForce(FinalTarget * 9, ForceMode2D.Impulse);

        //After Enough time Land
        yield return(new WaitForSeconds(0.5f));

        Debug.Log("land naturaly");
        _monSpeaker.PlayOneShot(_missedSound);
        Land();
    }
Esempio n. 3
0
 public void GetPickedUp()
 {
     _monSpeaker.PlayOneShot(_pickedSound);
     _CurrState = PickaxeState.Held;
 }