public override void OnInspectorGUI() { base.OnInspectorGUI(); ForceShieldController forceShieldController = (target as ForceShieldController); if (Application.isPlaying) { if (GUILayout.Button("Play appearing animation")) { forceShieldController.PlayAppearingAnimation(); } if (GUILayout.Button("Play disappearing animation")) { forceShieldController.PlayDisappearingAnimation(); } } else { GUILayout.Label("Enter PlayMode to be able to Play Animation"); } }
void Awake() { _forceShieldController = GetComponent <ForceShieldController>(); _camera = Camera.main; _collider = GetComponent <Collider>(); }