Esempio n. 1
0
 void Update()
 {
     if (Input.GetMouseButtonDown(0))
     {
         ShockWave.Get().StartIt(Input.mousePosition, true, speed, radiusOverTime, amplitudeOverTime, waveSizeOverTime);
     }
 }
Esempio n. 2
0
 /// <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();
 }
Esempio n. 3
0
 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);
     }
 }
Esempio n. 4
0
    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);
         }
     }
 }
Esempio n. 6
0
    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;
    }
Esempio n. 7
0
    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);
    }
Esempio n. 8
0
 // Use this for initialization
 void Start()
 {
     ShockWave.Get().StartIt(transform.position, radius, waveSpeed, amp, size);
 }
Esempio n. 9
0
 public void DestoryAll()
 {
     ShockWave.DestoryAll();
 }
Esempio n. 10
0
    /// <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();
 }
Esempio n. 13
0
 private void Awake()
 {
     _selectableLayer = 1 << 10;
     _shockWave       = FindObjectOfType <ShockWave>();
 }