void Update() { if (Input.GetMouseButtonDown(0)) { ShockWave.Get().StartIt(Input.mousePosition, true, speed, radiusOverTime, amplitudeOverTime, waveSizeOverTime); } }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here position.X = 0.5f; position.Y = 0.5f; splitterSystem = new SplitterSystem(GraphicsDevice.Viewport, position); shockwave = new ShockWave(GraphicsDevice.Viewport, position, Content); base.Initialize(); }
void Update() { if (Input.GetMouseButtonDown(0)) { SW = ShockWave.Get(); SW.SetPosition(Input.mousePosition, true); SW.radius = Random.Range(0.05f, 0.2f); SW.amplitude = Random.Range(0.05f, 0.2f); SW.waveSize = Random.Range(0.05f, 0.2f); } }
public void Ressucitate() { isDead = false; isFrozen = false; dieEvent.Invoke(this); ShockWave sw = Instantiate(reviveShockWavePrefab); sw.transform.position = this.transform.position; StartCoroutine(PlayTurnCoroutine()); }
// Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) { if (RevSW) { ShockWave.Get().ReverseIt(Input.mousePosition, true, Speed, MaxRadius, Amp, WS); } else { ShockWave.Get().StartIt(Input.mousePosition, true, Speed, MaxRadius, Amp, WS); } } }
private IEnumerator DieCoroutine() { yield return(new WaitForSeconds(1f)); isDead = true; dieEvent.Invoke(this); ParticleSystem particles = GetComponentInChildren <ParticleSystem>(); particles.Play(); ShockWave sw = Instantiate(dieShockWavePrefab); sw.transform.position = this.transform.position; }
void OnTriggerEnter(Collider other) { if (other.GetComponent <ShockWave> () == null || shockWavesAlreadyHurt.Contains(other.GetComponent <ShockWave> ())) { return; } ShockWave shockWave = other.GetComponent <ShockWave> (); Vector3 force = transform.position - other.transform.position; force *= bounceMultiplier * (1 - ((other.transform.localScale.x / 2) / shockWave.MaxRay)); m_body.velocity = Vector3.zero; m_body.AddForce(force * 5, ForceMode.Impulse); shockWavesAlreadyHurt.Add(shockWave); }
// Use this for initialization void Start() { ShockWave.Get().StartIt(transform.position, radius, waveSpeed, amp, size); }
public void DestoryAll() { ShockWave.DestoryAll(); }
/// <summary> /// Creates and Returns the ShockWave /// </summary> static public ShockWave Get() { ShockWave SW = Camera.main.gameObject.AddComponent <ShockWave>(); return(SW); }
public void UnPauseShockWaves() { ShockWave.AllUnPause(); }
public void PauseShockWaves() { ShockWave.AllPause(); }
private void Awake() { _selectableLayer = 1 << 10; _shockWave = FindObjectOfType <ShockWave>(); }