/**
         * <summary>Creates a new instance of the 'Object: Visibility' Action</summary>
         * <param name = "objectToAffect">The object to affect</param>
         * <param name = "newVisiblityState">The object's new visible state</param>
         * <param name = "affectChildren">If True, children of the object will be affected as well</param>
         * <returns>The generated Action</returns>
         */
        public static ActionVisible CreateNew(GameObject objectToAffect, VisState newVisiblityState, bool affectChildren = false)
        {
            ActionVisible newAction = (ActionVisible)CreateInstance <ActionVisible>();

            newAction.obToAffect     = objectToAffect;
            newAction.visState       = newVisiblityState;
            newAction.affectChildren = affectChildren;
            return(newAction);
        }
Esempio n. 2
0
    override public void ShowGUI()
    {
        obToAffect = (GameObject)EditorGUILayout.ObjectField("Object to affect:", obToAffect, typeof(GameObject), true);

        visState = (VisState)EditorGUILayout.EnumPopup("Visibility:", visState);

        affectChildren = EditorGUILayout.Toggle("Affect children?", affectChildren);

        AfterRunningOption();
    }
        override public void ShowGUI(List <ActionParameter> parameters)
        {
            parameterID = Action.ChooseParameterGUI("Object to affect:", parameters, parameterID, ParameterType.GameObject);
            if (parameterID >= 0)
            {
                constantID = 0;
                obToAffect = null;
            }
            else
            {
                obToAffect = (GameObject)EditorGUILayout.ObjectField("Object to affect:", obToAffect, typeof(GameObject), true);

                constantID = FieldToID(obToAffect, constantID);
                obToAffect = IDToField(obToAffect, constantID, false);
            }

            visState       = (VisState)EditorGUILayout.EnumPopup("Visibility:", visState);
            affectChildren = EditorGUILayout.Toggle("Affect children?", affectChildren);

            AfterRunningOption();
        }
Esempio n. 4
0
        public override void ShowGUI(List<ActionParameter> parameters)
        {
            parameterID = Action.ChooseParameterGUI ("Object to affect:", parameters, parameterID, ParameterType.GameObject);
            if (parameterID >= 0)
            {
                constantID = 0;
                obToAffect = null;
            }
            else
            {
                obToAffect = (GameObject) EditorGUILayout.ObjectField ("Object to affect:", obToAffect, typeof (GameObject), true);

                constantID = FieldToID (obToAffect, constantID);
                obToAffect = IDToField (obToAffect, constantID, false);
            }

            visState = (VisState) EditorGUILayout.EnumPopup ("Visibility:", visState);
            affectChildren = EditorGUILayout.Toggle ("Affect children?", affectChildren);

            AfterRunningOption ();
        }