public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { var l = EditorGUI.BeginProperty(position, label, property); position = EditorGUI.PrefixLabel(position, l); position.height = EditorGUIUtility.singleLineHeight; var block = property.FindPropertyRelative("block"); Fungus.Block b = block.objectReferenceValue as Fungus.Block; if (block.objectReferenceValue != null && lastFlowchart == null) { if (b != null) { lastFlowchart = b.GetFlowchart(); } } lastFlowchart = EditorGUI.ObjectField(position, lastFlowchart, typeof(Fungus.Flowchart), true) as Fungus.Flowchart; position.y += EditorGUIUtility.singleLineHeight; if (lastFlowchart != null) { b = Fungus.EditorUtils.BlockEditor.BlockField(position, new GUIContent("None"), lastFlowchart, b); } else { EditorGUI.PrefixLabel(position, new GUIContent("Flowchart Required")); } block.objectReferenceValue = b; block.serializedObject.ApplyModifiedProperties(); property.serializedObject.ApplyModifiedProperties(); EditorGUI.EndProperty(); }
void OnBlockEnd(Fungus.Block block) { if (block.BlockName.Equals("End")) { Fungus.BlockSignals.OnBlockEnd -= OnBlockEnd; inProgress = false; EventHandler.ExecuteEvent(m_InteractorGameObject, "OnAnimatorInteractionComplete"); if (m_ShouldTurnToInerviewer && navMeshAgent != null && isAlive()) { EnableBehavior(); SetDestination(destination); } } }
void OnBlockEnd(Fungus.Block block) { if (block.BlockName.Equals("End")) { Fungus.BlockSignals.OnBlockEnd -= OnBlockEnd; inProgress = false; EventHandler.ExecuteEvent(m_InteractorGameObject, "OnAnimatorInteractionComplete"); if (m_ShouldTurnToInerviewer && navMeshAgent != null && IsAlive()) { EnableAI(); if ((deathmatchAgent.TargetLayerMask & LayerMask.GetMask("Player")) != 0) { navMeshAgent.isStopped = false; } else { SetDestination(destination); } } } }