Ejemplo n.º 1
0
        void Remove_Static_Wheel_Parent_Script()
        {
            // Remove "Static_Wheel_Parent_CS" in this object.
            Static_Wheel_Parent_CS staticWheelParentScript = thisTransform.GetComponent <Static_Wheel_Parent_CS>();

            if (staticWheelParentScript)
            {
                EditorApplication.delayCall += () => DestroyImmediate(staticWheelParentScript);
            }
        }
Ejemplo n.º 2
0
        void Set_Static_Wheel_Parent_Script()
        {
            // Set "Static_Wheel_Parent_CS" in this object.
            Static_Wheel_Parent_CS staticWheelParentScript = thisTransform.GetComponent <Static_Wheel_Parent_CS>();

            if (staticWheelParentScript == null)
            {
                staticWheelParentScript = thisTransform.gameObject.AddComponent <Static_Wheel_Parent_CS>();
            }
            Mesh  wheelMesh   = Wheel_MeshProp.objectReferenceValue as Mesh;
            float wheelRadius = wheelMesh.bounds.extents.x;

            staticWheelParentScript.Wheel_Radius = wheelRadius + Radius_OffsetProp.floatValue;
        }
        void Set_Drive_Wheel_Parent_Script()
        {
            // Remove "Static_Wheel_Parent_CS" in this object.
            Static_Wheel_Parent_CS staticWheelParentScript = thisTransform.GetComponent <Static_Wheel_Parent_CS>();

            if (staticWheelParentScript)
            {
                EditorApplication.delayCall += () => DestroyImmediate(staticWheelParentScript);
            }

            // Set "Drive_Wheel_Parent_CS" in this object.
            Drive_Wheel_Parent_CS driveWheelParentScript = thisTransform.GetComponent <Drive_Wheel_Parent_CS>();

            if (driveWheelParentScript == null)
            {
                driveWheelParentScript = thisTransform.gameObject.AddComponent <Drive_Wheel_Parent_CS>();
            }
            driveWheelParentScript.Drive_Flag    = Drive_WheelProp.boolValue;
            driveWheelParentScript.Radius        = Wheel_RadiusProp.floatValue;
            driveWheelParentScript.Use_BrakeTurn = true;
        }
        void Set_Static_Wheel_Parent_Script()
        {
            // Remove "Drive_Wheel_Parent_CS" in this object.
            Drive_Wheel_Parent_CS driveWheelParentScript = thisTransform.GetComponent <Drive_Wheel_Parent_CS>();

            if (driveWheelParentScript)
            {
                EditorApplication.delayCall += () => DestroyImmediate(driveWheelParentScript);
            }

            // Set "Static_Wheel_Parent_CS" in this object.
            Static_Wheel_Parent_CS staticWheelParentScript = thisTransform.GetComponent <Static_Wheel_Parent_CS>();

            if (staticWheelParentScript == null)
            {
                staticWheelParentScript = thisTransform.gameObject.AddComponent <Static_Wheel_Parent_CS>();
            }
            Mesh  wheelMesh   = Wheel_MeshProp.objectReferenceValue as Mesh;
            float wheelRadius = wheelMesh.bounds.extents.x;

            staticWheelParentScript.Wheel_Radius = wheelRadius + Radius_OffsetProp.floatValue;
        }