Exemplo n.º 1
0
    /// <summary>
    /// AI противника езды с помощью сенсоров, при столкновении с бампером
    /// </summary>
    private void hlprScriptAIControlSensor()
    {
        hlprScriptUndefined();

        AIControlSensor aicontrolsensor = null;

        //script (2)
        if (this.gameObject.GetComponent <AIControlSensor>() == null)
        {
            aicontrolsensor = this.gameObject.AddComponent <AIControlSensor>();
        }
        if (this.gameObject.GetComponent <CarEffects>() == null)
        {
            this.gameObject.AddComponent <CarEffects>();
        }
        if (this.gameObject.GetComponent <CarSounds>() == null)
        {
            this.gameObject.AddComponent <CarSounds>();
        }

        //other (5)
        AddRigidBody(aicontrolsensor.Drag);
        AddMeshCollider();
        AddFollowPos();
        AddEffectDust();
        AddBumper();
    }
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        AIControlSensor script = (AIControlSensor)target;

        GUILayout.Label(script.EditorLabelText());
    }