private void Start() { this.rb = GetComponent <Rigidbody>(); this.rb.maxAngularVelocity = 21f; this.audioSource = GetComponent <AudioSource>(); this.LED = transform.Find("LED").gameObject; this.LED.GetComponent <Renderer>().material.color = Color.black; this.cubeModel = transform.Find("cube_model").gameObject; this.col = GetComponent <BoxCollider>(); this._power = powerStart; this.isRunning = powerStart; switch (version) { case Version.v2_0_0: this.impl = new CubeSimImpl_v2_0_0(this); break; case Version.v2_1_0: this.impl = new CubeSimImpl_v2_1_0(this); break; case Version.v2_2_0: this.impl = new CubeSimImpl_v2_2_0(this); break; case Version.v2_3_0: this.impl = new CubeSimImpl_v2_3_0(this); break; default: this.impl = new CubeSimImpl_v2_3_0(this); break; } this._InitPresetSounds(); }
private void Start() { #if !UNITY_EDITOR && !SIMULATOR_ONLY // Editor以外で実行される場合は自身を無効かします this.gameObject.SetActive(false); #else this.rb = GetComponent <Rigidbody>(); this.rb.maxAngularVelocity = 21f; this.audioSource = GetComponent <AudioSource>(); this.LED = transform.Find("LED").gameObject; this.LED.GetComponent <Renderer>().material.color = Color.black; this.cubeModel = transform.Find("cube_model").gameObject; this.col = GetComponent <BoxCollider>(); switch (version) { case Version.v2_0_0: this.impl = new CubeSimImpl_v2_0_0(this); break; default: this.impl = new CubeSimImpl_v2_0_0(this); break; } this._InitPresetSounds(); #endif }