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; } //GameObject.Destroy (sk, 3); }