void Deploy() { if (Index >= Skills.Length || Index < 0) { Index = 0; } FX_Position fx = Skills [Index].GetComponent <FX_Position> (); if (fx) { if (fx.Mode == SpawnMode.Static) { Place(Skills [Index]); } if (fx.Mode == SpawnMode.OnDirection) { PlaceDirection(Skills [Index]); } } else { Shoot(Skills [Index]); } }
void PlaceDirection(GameObject skill) { GameObject sk = (GameObject)GameObject.Instantiate(skill, this.transform.position + this.transform.forward, skill.transform.rotation); FX_Position fx = sk.GetComponent <FX_Position> (); if (fx.Mode == SpawnMode.OnDirection) { fx.transform.forward = this.transform.forward; } }
void PlaceDirection(GameObject skill) { GameObject sk = (GameObject)GameObject.Instantiate(skill, shotSpawnPoint.transform.position + shotSpawnPoint.transform.forward, skill.transform.rotation); FX_Position fx = sk.GetComponent <FX_Position> (); if (fx.Mode == SpawnMode.OnDirection) { fx.transform.forward = shotSpawnPoint.transform.forward; } magicAudio.PlayOneShot(spellAudioClip); Debug.Log("PlaceDirection"); //GameObject.Destroy (sk, 3); }
void Start() { timeTemp = Time.time; fx = Skills [Index].GetComponent <FX_Position> (); magicAudio = GetComponent <AudioSource> (); }