Exemplo n.º 1
0
 public void SpawnRanger(int index)
 {
     this.CancelInvoke(nameof(SpawnRanger));
     if (index >= 0)
     {
         this.lastRangerIndex = index;
     }
     if (Object.op_Implicit((Object)this.currentRanger) && !this.currentRanger.exploded)
     {
         Object.DestroyImmediate((Object)((Component)this.currentRanger).get_gameObject());
     }
     this.currentRanger = (EffectorExplode)((GameObject)Object.Instantiate <GameObject>((M0)this.rangerPrefabs[this.lastRangerIndex], this.spawnPosition.get_position(), Quaternion.get_identity())).GetComponent <EffectorExplode>();
     this.cursor.Show(true);
 }
    public void SpawnRanger(int index)
    {
        CancelInvoke("SpawnRanger");
        if (index >= 0)
        {
            lastRangerIndex = index;
        }

        if (currentRanger && !currentRanger.exploded)
        {
            DestroyImmediate(currentRanger.gameObject);
        }

        GameObject go = (GameObject)Instantiate(rangerPrefabs[lastRangerIndex], spawnPosition.position, Quaternion.identity);

        currentRanger = go.GetComponent <EffectorExplode>();
        cursor.Show(true);
    }