예제 #1
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        aiScript = (SAICSmartAICar)target;

        if(GUILayout.Button("Create Wheel Colliders")){

            WheelCollider[] wheelColliders = aiScript.gameObject.GetComponentsInChildren<WheelCollider>();

            if(wheelColliders.Length >= 1)
                Debug.LogError("Your Vehicle has Wheel Colliders already!");
            else
                aiScript.CreateWheelColliders();

        }

        DrawDefaultInspector();

        if(GUI.changed && !EditorApplication.isPlaying){
            EngineCurveInit();
        }

        serializedObject.ApplyModifiedProperties();
    }
예제 #2
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        aiScript = (SAICSmartAICar)target;

        if (GUILayout.Button("Create Wheel Colliders"))
        {
            WheelCollider[] wheelColliders = aiScript.gameObject.GetComponentsInChildren <WheelCollider>();

            if (wheelColliders.Length >= 1)
            {
                Debug.LogError("Your Vehicle has Wheel Colliders already!");
            }
            else
            {
                aiScript.CreateWheelColliders();
            }
        }

        DrawDefaultInspector();

        if (GUI.changed && !EditorApplication.isPlaying)
        {
            EngineCurveInit();
        }

        serializedObject.ApplyModifiedProperties();
    }
예제 #3
0
    void Start()
    {
        wheelCollider = GetComponent<WheelCollider>();
        carController = transform.root.GetComponent<SAICSmartAICar>();
        carRigid = carController.GetComponent<Rigidbody>();

        if(FindObjectOfType(typeof(SAICSkidmarks)))
            skidmarks = FindObjectOfType(typeof(SAICSkidmarks)) as SAICSkidmarks;
        else
            Debug.Log("No skidmarks object found. Skidmarks will not be drawn. Drag ''RCCSkidmarksManager'' from Prefabs folder, and drop on to your existing scene...");
    }
예제 #4
0
    void  Start()
    {
        wheelCollider = GetComponent <WheelCollider>();
        carController = transform.root.GetComponent <SAICSmartAICar>();
        carRigid      = carController.GetComponent <Rigidbody>();

        if (FindObjectOfType(typeof(SAICSkidmarks)))
        {
            skidmarks = FindObjectOfType(typeof(SAICSkidmarks)) as SAICSkidmarks;
        }
        else
        {
            Debug.Log("No skidmarks object found. Skidmarks will not be drawn. Drag ''RCCSkidmarksManager'' from Prefabs folder, and drop on to your existing scene...");
        }
    }
 void Awake()
 {
     aiScript = (SAICSmartAICar)target;
 }
예제 #6
0
파일: SAICEditor.cs 프로젝트: jmurillo7/PP
 void Awake()
 {
     aiScript = (SAICSmartAICar)target;
 }