public override bool OnGUI() { SetAgentAreaMask _target = (SetAgentAreaMask)target; bool edited = false; EditField("gameObject"); if (_target.NavMeshAreaMask == null) { _target.NavMeshAreaMask = new FsmInt(); _target.NavMeshAreaMask.Value = -1; } LayerMask _mask = _target.NavMeshAreaMask.Value; if (_maskField == null) { _maskField = new PlayMakerNavMeshAreaMaskField(); } LayerMask _newMask = _maskField.AreaMaskField("Area Mask", _mask, true); if (_newMask != _mask) { edited = true; _target.NavMeshAreaMask.Value = _newMask.value; } return(GUI.changed || edited); }
public override bool OnGUI() { SetAgentAreaMask _target = (SetAgentAreaMask)target; bool edited = false; EditField("gameObject"); if (_target.NavMeshAreaMask ==null) { _target.NavMeshAreaMask = new FsmInt(); _target.NavMeshAreaMask.Value = -1; } LayerMask _mask = _target.NavMeshAreaMask.Value; if (_maskField==null) { _maskField = new PlayMakerNavMeshAreaMaskField(); } LayerMask _newMask = _maskField.AreaMaskField("Area Mask",_mask,true); if (_newMask!=_mask) { edited = true; _target.NavMeshAreaMask.Value = _newMask.value; } return GUI.changed || edited; }
bool EditMaskField(NavMeshRaycast _target) { bool edited = false; if (_target.passableMask == null) { _target.passableMask = new FsmInt(); _target.passableMask.Value = -1; } if (_target.passableMask.UseVariable) { EditField("passableMask"); } else { GUILayout.BeginHorizontal(); LayerMask _mask = _target.passableMask.Value; if (_maskField == null) { _maskField = new PlayMakerNavMeshAreaMaskField(); } LayerMask _newMask = _maskField.AreaMaskField("Passable Mask", _mask, true); if (_newMask != _mask) { edited = true; _target.passableMask.Value = _newMask.value; } if (PlayMakerEditor.FsmEditorGUILayout.MiniButtonPadded(PlayMakerEditor.FsmEditorContent.VariableButton)) { _target.passableMask.UseVariable = true; } GUILayout.EndHorizontal(); } return(edited); }
bool EditMaskField(NavMeshRaycast _target) { bool edited = false; if (_target.passableMask ==null) { _target.passableMask = new FsmInt(); _target.passableMask.Value = -1; } if (_target.passableMask.UseVariable) { EditField("passableMask"); }else{ GUILayout.BeginHorizontal(); LayerMask _mask = _target.passableMask.Value; if (_maskField==null) { _maskField = new PlayMakerNavMeshAreaMaskField(); } LayerMask _newMask = _maskField.AreaMaskField("Passable Mask",_mask,true); if (_newMask!=_mask) { edited = true; _target.passableMask.Value = _newMask.value; } if (PlayMakerEditor.FsmEditorGUILayout.MiniButtonPadded(PlayMakerEditor.FsmEditorContent.VariableButton)) { _target.passableMask.UseVariable = true; } GUILayout.EndHorizontal(); } return edited; }