Spawn distance indicator on attack, destroy after 0.5s
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class DistanceIndicator : MonoBehaviour
|
||||
{
|
||||
@@ -8,12 +9,12 @@ public class DistanceIndicator : MonoBehaviour
|
||||
void Start()
|
||||
{
|
||||
player= GameObject.FindGameObjectWithTag("Player").GetComponent<Teo>();
|
||||
transform.localScale = new Vector3 (player.swingDistance*multiplier, player.swingDistance*multiplier, 1);
|
||||
StartCoroutine("KillMyself");
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
Debug.Log(player.swingDistance);
|
||||
transform.localScale = new Vector3 (player.swingDistance*multiplier, player.swingDistance*multiplier, 1);
|
||||
}
|
||||
IEnumerator KillMyself () {
|
||||
yield return new WaitForSeconds (0.5F);
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user