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;
 }
示例#2
0
 void Complete_Turret()
 { // Called from 'Turret_Finishing".
     This_Transform           = transform;
     Current_Angle            = This_Transform.localEulerAngles.x;
     Max_Elevation            = Current_Angle - Max_Elevation;
     Max_Depression           = Current_Angle + Max_Depression;
     Grabity                  = Physics.gravity.y;
     Turret_Horizontal_Script = transform.parent.GetComponent <Turret_Horizontal_CS>();
     Cannon_Fire_Script       = GetComponent <Cannon_Fire_CS>();
 }
示例#3
0
    void Complete_Turret()        // Called from 'Turret_Finishing".
    {
        switch (Type)
        {
        case 2:                                          // Turret
            MainBody_Transform       = GetComponentInParent <MainBody_Setting_CS> ().transform;
            Parent_Transform         = transform.parent; // Turret_Base
            Turret_Horizontal_Script = Parent_Transform.GetComponent <Turret_Horizontal_CS> ();
            break;

        case 3:                                    // Cannon
            Parent_Transform   = transform.parent; // Cannon_Base
            Cannon_Fire_Script = Parent_Transform.GetComponent <Cannon_Fire_CS> ();
            break;

        case 4:                                           // Barrel
            Parent_Transform   = transform.parent.parent; // Cannon_Base
            Cannon_Fire_Script = Parent_Transform.GetComponent <Cannon_Fire_CS> ();
            break;
        }
    }