SizilStank

Untitled

Mar 12th, 2020
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.01 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class PlayerAnimationEvents : MonoBehaviour
  6. {
  7.  
  8.     public float runParticlesX;
  9.     public float runParticlesY;
  10.  
  11.     public float jumpDustX;
  12.     public float jumpDustY;
  13.  
  14.     public float times = 5f;
  15.  
  16.     public GameObject runparticlesPrefab;
  17.     [SerializeField] GameObject jumpdustPrefab;
  18.  
  19.     PlayerMovement playermovement;
  20.  
  21.     private void Start()
  22.     {
  23.         playermovement = GameObject.Find("MainPlayer").GetComponent<PlayerMovement>();
  24.     }
  25.  
  26.     public void RunningParticles()
  27.     {
  28.           GameObject runparticles = Instantiate(runparticlesPrefab, transform.position + new Vector3(runParticlesX, runParticlesY, 0), Quaternion.identity);
  29.  
  30.           Destroy(runparticles, 0.5f);
  31.     }
  32.  
  33.     public void JumpDust()
  34.     {
  35.         GameObject jumpdust = Instantiate(jumpdustPrefab, transform.position + new Vector3(jumpDustX, jumpDustY, 0), Quaternion.identity);
  36.  
  37.         Destroy(jumpdust, 0.5f);
  38.     }
  39.  
  40. }
Add Comment
Please, Sign In to add comment