public void EnsureSetup() { if (mIsSetup) { return; } mIsSetup = false; Breath = GameObject.FindObjectOfType <ExcersizeBreathController> (); if (Player == null) { Player = this.GetComponent <AudioSource> (); } this.AllTracks = this.GetComponentsInChildren <VoiceOverInfo> (); foreach (var t in this.AllTracks) { t.EnsureSetup(); } foreach (var t in this.AllTracks) { if (t.IsPlayAtStart) { this.ChangeTrack(t); } } }
// Use this for initialization void Start() { if (!this.Breath) { this.Breath = GameObject.FindObjectOfType <ExcersizeBreathController> (); } if ((Hands == null) || (Hands.Length == 0)) { Hands = this.transform.parent.GetComponentsInChildren <ChiHandBehavior> (); } }
// Use this for initialization void Start() { Breather = GameObject.FindObjectOfType <ExcersizeBreathController> (); var mr = this.GetComponent <MeshRenderer> (); mr.material.SetFloat("MakeInstance", 1.0f); this.MatInst = mr.material; if (this.transform.childCount > 0) { ChildShape = this.transform.GetChild(0); } }
public void EnsureSetup() { if (this.Breath == null) { this.Breath = this.gameObject.GetComponent <ExcersizeBreathController> (); } if (this.Breath == null) { this.Breath = GameObject.FindObjectOfType <ExcersizeBreathController> (); Debug.Assert(this.Breath != null); } this.Breath.EnsureSetup(); }
// Use this for initialization void Start() { this.ParRenderer = this.GetComponent <ParticleSystem> (); this.BreathTimer = GameObject.FindObjectOfType <ExcersizeBreathController> (); int cnt = ((LineToShow == NamedLines.SpinalBreathing) ? 1 : 8); Particles = new ParticleSystem.Particle[cnt]; for (int i = 0; i < Particles.Length; i++) { Particles [i].position = Vector3.one * 0.1f * ((float)i); Particles [i].startColor = Color.green; Particles [i].velocity = Vector3.zero; Particles [i].startSize = 0.1f; Particles [i].startSize3D = Vector3.one * 0.1f; Particles [i].remainingLifetime = (float)(60 * 60 * 24); // 1 day } this.ParRenderer.SetParticles(this.Particles, this.Particles.Length); this.SetupCoreLine(); }