public override float ActionCharRenderRun(ActionCharRender action)
        {
            if (action.renderLock_scale == RenderLock.Set)
            {
                action._char.lockScale = true;

                float _scale = (float)action.scale / 100f;
                if (action._char.spriteChild != null)
                {
                    action._char.spriteScale = _scale;
                }
                else
                {
                    action._char.transform.localScale = new Vector3(_scale, _scale, _scale);
                }
            }
            else if (action.renderLock_scale == RenderLock.Release)
            {
                action._char.lockScale = false;
            }

            return(0f);
        }
        public override float ActionCharRenderRun(ActionCharRender action)
        {
            if (action.renderLock_scale == RenderLock.Set)
            {
                action._char.lockScale   = true;
                action._char.spriteScale = (float)action.scale / 100f;
            }
            else if (action.renderLock_scale == RenderLock.Release)
            {
                action._char.lockScale = false;
            }

            if (action.renderLock_direction == RenderLock.Set)
            {
                action._char.SetSpriteDirection(action.direction);
            }
            else if (action.renderLock_direction == RenderLock.Release)
            {
                action._char.lockDirection = false;
            }

            return(0f);
        }
        public override void ActionCharRenderGUI(ActionCharRender action)
        {
                        #if UNITY_EDITOR
            EditorGUILayout.Space();
            action.renderLock_scale = (RenderLock)EditorGUILayout.EnumPopup("Sprite scale:", action.renderLock_scale);
            if (action.renderLock_scale == RenderLock.Set)
            {
                action.scale = EditorGUILayout.IntField("New scale (%):", action.scale);
            }

            EditorGUILayout.Space();
            action.renderLock_direction = (RenderLock)EditorGUILayout.EnumPopup("Sprite direction:", action.renderLock_direction);
            if (action.renderLock_direction == RenderLock.Set)
            {
                action.direction = (CharDirection)EditorGUILayout.EnumPopup("New direction:", action.direction);
            }

            if (GUI.changed)
            {
                EditorUtility.SetDirty(action);
            }
                        #endif
        }
        public override float ActionCharRenderRun(ActionCharRender action)
        {
            if (action.renderLock_scale == RenderLock.Set)
            {
                action._char.lockScale = true;
                action._char.spriteScale = (float) action.scale / 100f;
            }
            else if (action.renderLock_scale == RenderLock.Release)
            {
                action._char.lockScale = false;
            }

            if (action.renderLock_direction == RenderLock.Set)
            {
                action._char.SetSpriteDirection (action.direction);
            }
            else if (action.renderLock_direction == RenderLock.Release)
            {
                action._char.lockDirection = false;
            }

            return 0f;
        }
        public override void ActionCharRenderGUI(ActionCharRender action)
        {
            #if UNITY_EDITOR

            EditorGUILayout.Space ();
            action.renderLock_scale = (RenderLock) EditorGUILayout.EnumPopup ("Sprite scale:", action.renderLock_scale);
            if (action.renderLock_scale == RenderLock.Set)
            {
                action.scale = EditorGUILayout.IntField ("New scale (%):", action.scale);
            }

            EditorGUILayout.Space ();
            action.renderLock_direction = (RenderLock) EditorGUILayout.EnumPopup ("Sprite direction:", action.renderLock_direction);
            if (action.renderLock_direction == RenderLock.Set)
            {
                action.direction = (CharDirection) EditorGUILayout.EnumPopup ("New direction:", action.direction);
            }

            if (GUI.changed)
            {
                EditorUtility.SetDirty (action);
            }

            #endif
        }
        public override float ActionCharRenderRun(ActionCharRender action)
        {
            if (action.renderLock_scale == RenderLock.Set)
            {
                action._char.lockScale = true;

                if (action._char.spriteChild != null)
                {
                    action._char.spriteScale = (float) action.scale / 100f;
                }
                else
                {
                    float _scale = (float) action.scale;
                    action._char.transform.localScale = new Vector3 (_scale, _scale, _scale);
                }
            }
            else if (action.renderLock_scale == RenderLock.Release)
            {
                action._char.lockScale = false;
            }

            return 0f;
        }
 public virtual float ActionCharRenderRun(ActionCharRender action)
 {
     return(0f);
 }
 public virtual void ActionCharRenderGUI(ActionCharRender action)
 {
 }
Exemple #9
0
 public virtual float ActionCharRenderRun(ActionCharRender action)
 {
     return 0f;
 }
Exemple #10
0
 public virtual void ActionCharRenderGUI(ActionCharRender action)
 {
 }
Exemple #11
0
 public virtual void ActionCharRenderGUI(ActionCharRender action, List <ActionParameter> parameters)
 {
     ActionCharRenderGUI(action);
 }
        public override float ActionCharRenderRun(ActionCharRender action)
        {
            if (action.renderLock_scale == RenderLock.Set)
            {
                action._char.lockScale = true;
                action._char.spriteScale = (float) action.scale / 100f;
            }
            else if (action.renderLock_scale == RenderLock.Release)
            {
                action._char.lockScale = false;
            }

            if (action.renderLock_direction == RenderLock.Set)
            {
                action._char.SetSpriteDirection (action.direction);
            }
            else if (action.renderLock_direction == RenderLock.Release)
            {
                action._char.lockDirection = false;
            }

            if (action.renderLock_sortingMap != RenderLock.NoChange && action._char.GetComponentInChildren <FollowSortingMap>())
            {
                FollowSortingMap[] followSortingMaps = action._char.GetComponentsInChildren <FollowSortingMap>();
                SortingMap sortingMap = (action.renderLock_sortingMap == RenderLock.Set) ? action.sortingMap : KickStarter.sceneSettings.sortingMap;

                foreach (FollowSortingMap followSortingMap in followSortingMaps)
                {
                    followSortingMap.SetSortingMap (sortingMap);
                }
            }

            return 0f;
        }