// Start is called before the first frame update void Start() { areaOfEffect = this.transform.GetComponent <Collider>(); anim = this.transform.GetComponent <Animator>(); ted = FindObjectOfType <Teddy>(); foreach (Light lite in lights) { lite.enabled = false; } engineAudio.loop = true; scramblingAudio.loop = true; if (strikePlaneFlyingNoise) { engineAudio.clip = strikePlaneFlyingNoise; } if (scramblingNoise) { scramblingAudio.clip = scramblingNoise; } StrikeState = StrikeMode.Idle; isAvailable = true; isScrambling = false; }
public void Suspend() { isScrambling = false; foreach (Light lite in lights) { lite.enabled = false; } engineAudio.Stop(); scramblingAudio.Stop(); anim.SetTrigger("Be still"); StrikeState = StrikeMode.Idle; }
public void CallStrike() { this.transform.position = ted.transform.TransformPoint(strikePlaneLocationStartRelativeToTed); this.transform.LookAt(new Vector3(ted.transform.position.x, this.transform.position.y - ted.transform.position.y, ted.transform.position.z)); tedsLastPosition = ted.transform.position; isScrambling = false; foreach (Light lite in lights) { lite.enabled = true; } anim.SetTrigger("Move forward"); engineAudio.Play(); scramblingAudio.Stop(); strikeDurationRefTime = Time.time; StrikeState = StrikeMode.Striking; }
public static StrikeBox Get(float Height, float Width, float Depth, float Margin, float Thickness, StrikeMode Mode, float OffsetM, float OffsetP) { var box = Get(Height, Width, Depth); box.margin = Margin; box.thickness = Thickness; box.mode = Mode; box.offsetPlus = OffsetP; box.offsetMinus = OffsetM; return(box); }