Exemplo n.º 1
0
 /// <summary> Panel to show all active "Events" while playing </summary>
 /// <param name="inlineHelp">Should help be displayed?</param>
 void EventsPanel(bool inlineHelp)
 {
     ++EditorGUI.indentLevel;
     EditorGUILayout.BeginHorizontal();
     {
         if (m_editorUtils.Button("AddEventButton", inlineHelp, GUILayout.Width(40)) && !string.IsNullOrEmpty(tmpTrigger))
         {
             AmbienceManager.ActivateEvent(tmpTrigger);
             tmpTrigger = "";
         }
         tmpTrigger = GUILayout.TextField(tmpTrigger);
     }
     EditorGUILayout.EndHorizontal();
     foreach (string str in AmbienceManager.GetEvents())
     {
         EditorGUILayout.BeginHorizontal();
         {
             if (m_editorUtils.Button("RemoveEventButton", GUILayout.Width(40)))
             {
                 AmbienceManager.DeactivateEvent(str);
             }
             GUILayout.Label(str);
         }
         EditorGUILayout.EndHorizontal();
     }
     --EditorGUI.indentLevel;
 }
Exemplo n.º 2
0
 private void Update()
 {
     if (enemyReference1 == null &&
         enemyReference2 == null &&
         enemyReference3 == null)
     {
         AmbienceManager.DeactivateEvent("Combat");
     }
     else
     {
         AmbienceManager.ActivateEvent("Combat");
     }
 }
Exemplo n.º 3
0
 /// <summary> Checks position in LateUpdate after everything should have finished moving </summary>
 private void LateUpdate()
 {
     if (PlayerObject == null)
     {
         AmbienceManager manager = FindObjectOfType <AmbienceManager>();
         if (manager)
         {
             PlayerObject = manager.m_playerObject;
         }
         else
         {
             Camera mainCamera = Camera.main;
             if (mainCamera)
             {
                 PlayerObject = mainCamera.transform;
             }
             else
             {
                 Debug.LogWarning("No Player Object specified, no AmbienceManager found, and no Camera. Unable to auto-select object.", this);
                 return;
             }
         }
     }
     if (PlayerObject)
     {
         if (isWithin(PlayerObject.position))
         {
             if (!lastWasSet)
             {
                 lastWasSet = true;
                 AmbienceManager.ActivateEvent(EventName);
             }
         }
         else
         {
             if (lastWasSet)
             {
                 lastWasSet = false;
                 AmbienceManager.DeactivateEvent(EventName);
             }
         }
     }
 }
Exemplo n.º 4
0
 public void PlayHeartBeat()
 {
     AmbienceManager.AddSequence(Heartbeat);
     AmbienceManager.ActivateEvent("Heartbeat");
 }