Example #1
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        VacuumSound script = (VacuumSound)target;

        if (GUILayout.Button("Start Engine"))
        {
            if (Application.isPlaying)
            {
                script.StartEngine();
            }
        }

        if (GUILayout.Button("Stop Engine"))
        {
            if (Application.isPlaying)
            {
                script.StopEngine();
            }
        }

        if (GUI.changed)
        {
            EditorUtility.SetDirty(vacuumSound);
        }

        serializedVacuumSound.ApplyModifiedProperties();
    }
Example #2
0
 private void Start()
 {
     spring       = GetComponent <SpringJoint>();
     inputHandler = new MouseDragHandler(this, GetTriggerCollider(), spring);
     mat          = GetComponent <Renderer>().material;
     sound        = GetComponent <VacuumSound>();
     DustSuckerSwitch.DustSuckerStatus             += UpdateDustSuckerStatus;
     ConnectorDragAndDrop.DustSuckerConnectionLost += UpdateDustSuckerStatus;
 }
Example #3
0
    public override void OnUseUp(Hero hero)
    {
        Transform vacuum = hero.gameObject.transform.Find("perso").Find("vacuum").Find("vacuumActivable");

        vacuum.gameObject.SetActive(false);
        Transform   v  = hero.gameObject.transform.Find("perso").Find("vacuum");
        VacuumSound vs = v.GetComponent <VacuumSound>();

        vs.VacuumUsed = false;
    }
Example #4
0
 private void Start()
 {
     CheckFields();
     drag        = GetComponent <DragScript>();
     vacuumSound = GetComponent <VacuumSound>();
     meltShader  = Shader.Find(meltShaderID);
     DustSuckerSwitch.DustSuckerStatus             += ChangeDustSuckerStatus;
     ConnectorDragAndDrop.DustSuckerConnectionLost += ChangeDustSuckerStatus;
     NitrousOxideSystems.NitrousStageChanged       += ChangeNitrousStage;
 }
Example #5
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        VacuumSound script = (VacuumSound)target;

        if (GUILayout.Button("Start Engine"))
        {
            script.StartEngine();
        }

        if (GUILayout.Button("Stop Engine"))
        {
            script.StopEngine();
        }
    }
Example #6
0
 /// <summary>
 /// Called everytime the inspected object is selected.
 /// </summary>
 private void OnEnable()
 {
     vacuumSound           = (VacuumSound)target;
     serializedVacuumSound = new SerializedObject(vacuumSound);
 }