예제 #1
0
    void Start()
    {
        switch (Type)
        {
        case 0:          // Engine Sound.
            This_AudioSource.loop   = true;
            This_AudioSource.volume = 0.0f;
            This_AudioSource.Play();
            // In case of "Physics_Track".
            if (transform.parent.GetComponentInChildren <Static_Track_CS> () == null)
            {
                Set_Reference();
            }
            break;

        case 1:          // Impact Sound.
            This_AudioSource.loop = false;
            MainBody_RigidBody    = GetComponent <Rigidbody> ();
            break;

        case 2:          // Turret Motor Sound.
            This_AudioSource.loop = true;
            Turret_Script         = GetComponent <Turret_Horizontal_CS> ();
            break;

        case 3:          // Cannon Motor Sound.
            This_AudioSource.loop = true;
            Cannon_Script         = GetComponent <Cannon_Vertical_CS> ();
            break;
        }
    }
 void Start()
 {
     control_angles    = GetComponent <Control_Angles>();
     cannon_vertical   = cannon_base.GetComponent <Cannon_Vertical_CS>();
     cannon_fire       = cannon_base.GetComponent <Cannon_Fire_CS>();
     turret_horizontal = turret_objects.GetComponentInChildren <Turret_Horizontal_CS>();
     turret_base       = turret_horizontal.gameObject;
 }