示例#1
0
    void Start()
    {
        dashDistance = 0;
        dashWidth    = 0.30f;

        this.duration = 0;
        dashTimer     = 0;
        Vector2 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
        float   xDiff    = mousePos.x - transform.position.x;
        float   yDiff    = mousePos.y - transform.position.y;



        dashDirection = getAngle(xDiff, yDiff);
        dashSpeed     = dashDistance;

        faceMouse         = transform.GetComponentInChildren <FaceMouse>();
        faceMouse.enabled = true;
        idleAnimeState    = dashing.GetCurrentAnimatorStateInfo(0).fullPathHash;

        moveVector      = new Vector3(dashSpeed * Mathf.Cos(dashDirection), dashSpeed * Mathf.Sin(dashDirection), 0);
        dashing.enabled = true;
        boolSpin        = false;
        boolDash        = false;
        source          = GetComponent <AudioSource>();
    }
 // Start is called before the first frame update
 void Start()
 {
     PlayerRigi     = this.GetComponent <Rigidbody2D>();
     PlayerAnimator = transform.GetComponent <Animator>();
     vector         = transform.localScale;
     faceMouse      = transform.Find("AttackCollision").GetComponent <FaceMouse>();
 }
 // Start is called before the first frame update
 void Start()
 {
     playerMovement = GetComponent <PlayerMovement>();
     playerShooting = GetComponent <PlayerShooting>();
     faceMouse      = GetComponent <FaceMouse>();
     anim           = GetComponent <Animator>();
     currentHealth  = health;
 }
示例#4
0
 void Start()
 {
     body         = GetComponent <Rigidbody2D>();
     speed        = Vector2.zero;
     mouse        = GetComponent <FaceMouse>();
     anim         = GetComponent <Animator>();
     anim         = Animations.GetComponent <Animator>();
     spriteRender = Animations.GetComponent <SpriteRenderer>();
     lastPosition = Vector3.zero;
     health       = maxHealth;
 }
示例#5
0
    void Start()
    {
        playerSprite       = GetComponent <SpriteRenderer>();
        facemouse          = arm.GetComponent <FaceMouse>();
        experience         = GetComponent <Experience>();
        currentStamina     = maxStamina;
        velocidadeOriginal = velocidade;
        rigid       = GetComponent <Rigidbody2D> ();
        anim        = GetComponent <Animator>();
        playerAudio = GetComponent <AudioSource>();

        playerHealth = GetComponent <PlayerHealth>();
        Velocidade();
        originalColor = this.gameObject.GetComponent <SpriteRenderer>().color;
        dashTime      = dashReloadTime + experience.dashBonus;
    }
 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     faceMouse = GameObject.FindGameObjectWithTag("Player").transform.Find("AttackCollision").GetComponent <FaceMouse>();
 }