public void SendSignal(SoundProjector.ProjectorType type, float arc, Vector2 direction) { float angle = SoundProjector.GetFullAngle(direction); GameObject temp = new GameObject(); temp.transform.position = this.transform.position; //temp.transform.rotation = this.transform.rotation; SoundProjector proj = temp.AddComponent <SoundProjector>(); proj.Project(type, angle, arc); }
// Update is called once per frame void Update() { bool project = Input.GetKeyUp(KeyCode.K); if (project) { GameObject temp = new GameObject(); temp.transform.position = this.transform.position; temp.transform.rotation = this.transform.rotation; SoundProjector proj = temp.AddComponent <SoundProjector>(); proj.Project(); } }