public void OnSceneGUI()
        {
            if (bNoGrid || PrefabHelper.IsPrefab(_target.gameObject))
            {
                return;
            }

            if (!_snapFree.boolValue)
            {
                int iOddCount = 9;
                for (int i = 0; i < iOddCount; ++i)
                {
                    Handles.color = Color.red;
                    Handles.DotHandleCap(i * 3, _target.transform.position
                                         + new Vector3((i - (iOddCount - 1) / 2) * _target.GridInterval.x, 0, 0),
                                         Quaternion.identity, 0.025f, EventType.Repaint);
                    Handles.color = Color.green;
                    Handles.DotHandleCap(i * 3 + 1, _target.transform.position
                                         + new Vector3(0, (i - (iOddCount - 1) / 2) * _target.GridInterval.y, 0),
                                         Quaternion.identity, 0.025f, EventType.Repaint);
                    Handles.color = Color.blue;
                    Handles.DotHandleCap(i * 3 + 2, _target.transform.position
                                         + new Vector3(0, 0, (i - (iOddCount - 1) / 2) * _target.GridInterval.z),
                                         Quaternion.identity, 0.025f, EventType.Repaint);
                }
            }
        }
 private void OnEnable()
 {
     if (IsPrefab = PrefabHelper.IsPrefab(targets.Select(r => (r as SubColliderHelper).gameObject).ToArray()))
     {
         return;
     }
 }
예제 #3
0
 void OnEnable()
 {
     if (bPrefab = PrefabHelper.IsPrefab((target as Iso2DObject).gameObject))
     {
         return;
     }
 }
예제 #4
0
        public void OnSceneGUI()
        {
            if (PrefabHelper.IsPrefab(_bulk.gameObject))
            {
                return;
            }

            if (_bulkGrid.IsInheritGrid)
            {
                return;
            }

            int     iOddCount = 9;
            Vector3 _centor   = _bulkGrid.transform.position;

            for (int i = 0; i < iOddCount; ++i)
            {
                Handles.color = Color.red;
                Handles.CircleHandleCap(iOddCount + i * 3, _centor
                                        + new Vector3((i - (iOddCount - 1) / 2) * _bulkGrid.GridInterval.x, 0, 0),
                                        SceneView.currentDrawingSceneView.camera.transform.rotation, 0.05f, EventType.Repaint);
                Handles.color = Color.green;
                Handles.CircleHandleCap(iOddCount + i * 3 + 1, _centor
                                        + new Vector3(0, (i - (iOddCount - 1) / 2) * _bulkGrid.GridInterval.y, 0),
                                        SceneView.currentDrawingSceneView.camera.transform.rotation, 0.05f, EventType.Repaint);
                Handles.color = Color.blue;
                Handles.CircleHandleCap(iOddCount + i * 3 + 2, _centor
                                        + new Vector3(0, 0, (i - (iOddCount - 1) / 2) * _bulkGrid.GridInterval.z),
                                        SceneView.currentDrawingSceneView.camera.transform.rotation, 0.05f, EventType.Repaint);
            }
        }
예제 #5
0
        void OnEnable()
        {
            if (target == null || Selection.activeGameObject == null)
            {
                return;
            }

            if (bPrefab = PrefabHelper.IsPrefab(targets.Select(r => (r as IsoTile).gameObject).ToArray()))
            {
                return;
            }

            update_InspectorTile();

            if (screenInfoFontStyle == null)
            {
                screenInfoFontStyle = new GUIStyle();
                screenInfoFontStyle.normal.textColor = Color.green;
                screenInfoFontStyle.fontStyle        = FontStyle.Bold;
                screenInfoFontStyle.fontSize         = 15;
            }

            if (SceneView.lastActiveSceneView != null && bFrameSelected)
            {
                SceneView.lastActiveSceneView.FrameSelected(false);
            }
        }
예제 #6
0
        public void SetTarget()
        {
            EditorGUILayout.Separator();
            EditorGUILayout.LabelField("[Target Select Helper]", EditorStyles.boldLabel);
            lookupObject = EditorGUILayout.ObjectField(lookupObject, typeof(GameObject), allowSceneObjects: true) as GameObject;
            if (lookupObject != null && PrefabHelper.IsPrefab(lookupObject))
            {
                lookupObject = null;
                Debug.Log("Prefab is not allowed. Please select only the GameObject in the scene.");
            }
            if (lookupObject)
            {
                using (new EditorGUILayout.HorizontalScope())
                {
                    bIncludeChild = EditorGUILayout.ToggleLeft("Include Child", bIncludeChild);
                    if (GUILayout.Button("Add"))
                    {
                        light.AddTarget(lookupObject, bIncludeChild);
                    }
                    if (GUILayout.Button("Remove"))
                    {
                        light.RemoveTarget(lookupObject, bIncludeChild);
                    }
                }
            }
            EditorGUILayout.Separator();
            layerMask = CustomEditorGUI.LayerMaskField("Layer Mask for Add/Remove", layerMask);
            GUILayoutOption halfWidth = GUILayout.Width(EditorGUIUtility.currentViewWidth * 0.5f);

            using (new EditorGUILayout.HorizontalScope())
            {
                using (new EditorGUI.DisabledGroupScope(layerMask == 0))
                {
                    if (GUILayout.Button("Add all Masked Iso2DBase", halfWidth))
                    {
                        light.AddTarget_All(layerMask);
                    }
                    if (GUILayout.Button("Clear all Masked layer", halfWidth))
                    {
                        light.RemoveTarget_All(layerMask);
                    }
                }
            }
            EditorGUILayout.Separator();
            using (new EditorGUILayout.HorizontalScope())
            {
                if (GUILayout.Button("Add all Iso2DBase", halfWidth))
                {
                    light.AddTarget_All(layerMask);
                }
                if (GUILayout.Button("Clear TargetList", halfWidth))
                {
                    light.RemoveTarget_All();
                }
            }
        }
예제 #7
0
        private void OnValidate()
        {
            if (PrefabHelper.IsPrefab(gameObject) == true || Tile == null)
            {
                return;
            }

            UpdateIsometricRotationScale();
            AdjustScale();
        }
예제 #8
0
 void OnEnable()
 {
     _t = (AutoNaming)target;
     if (bPrefab = PrefabHelper.IsPrefab(_t.gameObject))
     {
         return;
     }
     OnOffToggle    = serializedObject.FindProperty("bAutoName");
     Postfix_Sprite = serializedObject.FindProperty("bPostfix_Sprite");
     formatString   = serializedObject.FindProperty("format");
 }
예제 #9
0
 bool bPrefabCheck(bool bPrintErrorMSG = true)
 {
     if (PrefabHelper.IsPrefab(gameObject))
     {
         if (bPrintErrorMSG)
         {
             Debug.LogError("Not available when Prefab.");
         }
         return(true);
     }
     return(false);
 }
예제 #10
0
        void OnEnable()
        {
            _bulk = (IsoTileBulk)target;
            if (bPrefab = PrefabHelper.IsPrefab(_bulk.gameObject))
            {
                return;
            }

            _SizeXZ   = serializedObject.FindProperty("SizeXZ");
            _RefTile  = serializedObject.FindProperty("_referenceTile");
            _bulkGrid = _bulk.gameObject.GetComponent <Grid>();
            refresh_Child(true);
            refresh_ConnectedBulk();
        }
예제 #11
0
        void OnEnable()
        {
            _targetIsoBasis = target as ISOBasis;
            if (target != null && (bPrefab = PrefabHelper.IsPrefab(_targetIsoBasis.gameObject)))
            {
                return;
            }

            _ISOTarget = _targetIsoBasis.GetComponent <IISOBasis>();
            _spDoNotDestroyAutomatically = serializedObject.FindProperty("bDoNotDestroyAutomatically");
            _spISOOffest          = serializedObject.FindProperty("_ISO_Offset");
            _spOnGroundObject     = serializedObject.FindProperty("isOnGroundObject");
            _spTransformsForFudge = serializedObject.FindProperty("transforms");
        }
예제 #12
0
        public bool Regist_Bulk(IsoTileBulk _add)
        {
            if (_add == null || PrefabHelper.IsPrefab(_add.gameObject))
            {
                return(false);
            }

            if (_childBulkList.Contains(_add))
            {
                return(false);
            }

            _childBulkList.Add(_add);
            return(true);
        }
예제 #13
0
        void OnEnable()
        {
            if ((_target = (IsometricSortingOrder)target) == null)
            {
                return;
            }

            if (bPrefab = PrefabHelper.IsPrefab(_target.gameObject))
            {
                return;
            }

            _iParticleSortingAdd = serializedObject.FindProperty("iParticleSortingAdd");
            _iLastSortingOrder   = serializedObject.FindProperty("iLastSortingOrder");
            _iExternSortingAdd   = serializedObject.FindProperty("_iExternAdd");
            // _bStaticISO = serializedObject.FindProperty("bStaticISO");
        }
예제 #14
0
        public static ValidActions GetValidActions(string assetPath, Object instance = null)
        {
            if (!VCCommands.Active || string.IsNullOrEmpty(assetPath))
            {
                return(noAction);
            }

            var assetStatus = VCCommands.Instance.GetAssetStatus(assetPath);

            ValidActions validActions;
            bool         isPrefab              = instance != null && PrefabHelper.IsPrefab(instance);
            bool         isPrefabParent        = isPrefab && PrefabHelper.IsPrefabParent(instance);
            bool         isFolder              = AssetDatabase.IsValidFolder(assetPath);
            bool         diffableAsset         = VCUtility.IsDiffableAsset(assetPath);
            bool         mergableAsset         = VCUtility.IsMergableAsset(assetPath);
            bool         modifiedDiffableAsset = diffableAsset && assetStatus.fileStatus != VCFileStatus.Normal;
            bool         modifiedMeta          = assetStatus.MetaStatus().fileStatus != VCFileStatus.Normal;
            bool         lockedMeta            = assetStatus.MetaStatus().lockStatus == VCLockStatus.LockedHere;
            bool         modified              = assetStatus.fileStatus == VCFileStatus.Modified;
            bool         deleted        = assetStatus.fileStatus == VCFileStatus.Deleted;
            bool         added          = assetStatus.fileStatus == VCFileStatus.Added;
            bool         unversioned    = assetStatus.fileStatus == VCFileStatus.Unversioned;
            bool         ignored        = assetStatus.fileStatus == VCFileStatus.Ignored;
            bool         replaced       = assetStatus.fileStatus == VCFileStatus.Replaced;
            bool         lockedByOther  = assetStatus.lockStatus == VCLockStatus.LockedOther;
            bool         managedByRep   = VCUtility.ManagedByRepository(assetStatus);
            bool         haveControl    = VCUtility.HaveAssetControl(assetStatus);
            bool         haveLock       = VCUtility.HaveVCLock(assetStatus);
            bool         allowLocalEdit = assetStatus.LocalEditAllowed();
            bool         pending        = assetStatus.reflectionLevel == VCReflectionLevel.Pending;

            validActions.showAdd        = !pending && !ignored && unversioned;
            validActions.showOpen       = !pending && !validActions.showAdd && !added && !haveLock && !deleted && !isFolder && !mergableAsset && (!lockedByOther || allowLocalEdit);
            validActions.showDiff       = !pending && !ignored && !deleted && modifiedDiffableAsset && managedByRep;
            validActions.showCommit     = !pending && !ignored && !allowLocalEdit && (haveLock || added || deleted || modifiedDiffableAsset || isFolder || modifiedMeta);
            validActions.showRevert     = !pending && !ignored && !unversioned && (haveControl || modified || added || deleted || replaced || modifiedDiffableAsset || modifiedMeta || lockedMeta);
            validActions.showDelete     = !pending && !ignored && !deleted && !lockedByOther;
            validActions.showOpenLocal  = !pending && !ignored && !deleted && !isFolder && !allowLocalEdit && !unversioned && !added && !haveLock && !mergableAsset;
            validActions.showUnlock     = !pending && !ignored && !allowLocalEdit && haveLock;
            validActions.showUpdate     = !pending && !ignored && !added && managedByRep && instance != null;
            validActions.showForceOpen  = !pending && !ignored && !deleted && !isFolder && !allowLocalEdit && !unversioned && !added && lockedByOther && Event.current.shift;
            validActions.showDisconnect = isPrefab && !isPrefabParent;

            return(validActions);
        }
예제 #15
0
        public void Add_TallCharacterHelper()
        {
            if (PrefabHelper.IsPrefab(gameObject))
            {
                Debug.LogError("Not available when Prefab.");
                return;
            }

            findTCH();
            if (_tch != null)
            {
                Debug.Log("This already has a TCH.");
                return;
            }

            string err = null;

            if (IsoMap.IsNull)
            {
                err = "There is no IsoMap instance!";
            }
            else if (IsoMap.instance.TchPrefab == null)
            {
                err = "There is no IsoMap.Instance.TCHPrefab!";
            }
            else
            {
                _tch = Instantiate(IsoMap.instance.TchPrefab).GetComponent <TallCharacterHelper>();
                if (_tch == null)
                {
                    err = "There is no TallCharacterHelper component in the IsoMap.Instance.TCHPrefab!!";
                }
            }

            if (err != null)
            {
                Debug.LogError(err);
                return;
            }

            _tch.transform.SetParent(transform);
            _tch.transform.localPosition = Vector3.zero;
            _tch.Init();
        }
예제 #16
0
        void OnEnable()
        {
            if ((light = (IsoLight)target) == null)
            {
                return;
            }
            if (bPrefab = PrefabHelper.IsPrefab(light.gameObject))
            {
                return;
            }

            targetList = serializedObject.FindProperty("targetList");

            MutelightList.Clear();
            lightList.Clear();
            lightList.AddRange(FindObjectsOfType <IsoLight>());

            bTemporaryToggle_Static = bTemporaryToggle_Dynamic = false;
        }
예제 #17
0
        void OnEnable()
        {
            if ((_grid = (Grid)target) == null)
            {
                return;
            }

            if (bPrefab = PrefabHelper.IsPrefab(_grid.gameObject))
            {
                return;
            }

            _sp_LocalGrid         = serializedObject.FindProperty("bUseLocalGrid");
            _sp_LocalScale        = serializedObject.FindProperty("_TileSize");
            _sp_LocalAxisInterval = serializedObject.FindProperty("_GridInterval");
            bRootGrid             = _grid.GetComponent <IsoMap>() != null;
            BulkList_Update();
            // TileList_AutoUpdate(true);
        }
예제 #18
0
        void OnEnable()
        {
            _rc = (RegularCollider)target;
            if (_rc == null)
            {
                return;
            }

            if (target != null && (IsPrefab = PrefabHelper.IsPrefab(_rc.gameObject)))
            {
                return;
            }


            _t = _rc.GetComponentInParent <IsoTile>();

            _spIso2DScaleMultiplier = serializedObject.FindProperty("_vIso2DScaleMultiplier");

            update_childIso2D_0();
            // _r.update_subColliders();
        }
예제 #19
0
        void OnEnable()
        {
            isoMap = target as IsoMap;

            if (IsPrefab = PrefabHelper.IsPrefab(isoMap.gameObject))
            {
                return;
            }

            isoMap.UpdateIsometricSortingResolution();
            // isoMap.Update_TileAngle();
            spBISSO               = serializedObject.FindProperty("bUseIsometricSorting");
            spTileAngle           = serializedObject.FindProperty("TileAngle");
            spReferencePPU        = serializedObject.FindProperty("ReferencePPU");
            bEditPrefab           = false;
            spBulkPrefab          = serializedObject.FindProperty("BulkPrefab");
            spTilePrefab          = serializedObject.FindProperty("TilePrefab");
            spObstacle            = serializedObject.FindProperty("ObstaclePrefab");
            spTriggerCubeOverlay  = serializedObject.FindProperty("TriggerCubePrefab");
            spTriggerPlaneOverlay = serializedObject.FindProperty("TriggerPlanePrefab");
            spOverlay             = serializedObject.FindProperty("OverlayPrefab");
            spSideUnion           = serializedObject.FindProperty("Side_Union_Prefab");
            spSideX               = serializedObject.FindProperty("Side_X_Prefab");
            spSideY               = serializedObject.FindProperty("Side_Y_Prefab");
            spSideZ               = serializedObject.FindProperty("Side_Z_Prefab");
            spRCU                   = serializedObject.FindProperty("Collider_Cube_Prefab");
            spRCX                   = serializedObject.FindProperty("Collider_X_Prefab");
            spRCY                   = serializedObject.FindProperty("Collider_Y_Prefab");
            spRCZ                   = serializedObject.FindProperty("Collider_Z_Prefab");
            spGameCamera            = serializedObject.FindProperty("GameCamera");
            spUseCustomResolution   = serializedObject.FindProperty("bCustomResolution");
            spCustomResolution      = serializedObject.FindProperty("vCustomResolution");
            spTchPrefab             = serializedObject.FindProperty("TchPrefab");
            spUseGroundObjectOffset = serializedObject.FindProperty("bUseGroundObjectOffset");
            spGroundObjectOffset    = serializedObject.FindProperty("fOnGroundOffset");
        }
예제 #20
0
        public static ValidActions GetValidActions(string assetPath, Object instance = null)
        {
            using (sceneviewUpdateMarker.Auto())
            {
                if (!VCCommands.Active || string.IsNullOrEmpty(assetPath))
                {
                    return(noAction);
                }

                var assetStatus = VCCommands.Instance.GetAssetStatus(assetPath);

                bool isPrefab              = instance != null && PrefabHelper.IsPrefab(instance);
                bool isPrefabParent        = isPrefab && PrefabHelper.IsPrefabParent(instance);
                bool isFolder              = AssetDatabase.IsValidFolder(assetPath);
                bool diffableAsset         = MergeHandler.IsDiffableAsset(assetPath);
                bool mergableAsset         = MergeHandler.IsMergableAsset(assetPath);
                bool modifiedDiffableAsset = diffableAsset && assetStatus.fileStatus != VCFileStatus.Normal;
                bool modifiedMeta          = assetStatus.MetaStatus().fileStatus != VCFileStatus.Normal;
                bool lockedMeta            = assetStatus.MetaStatus().lockStatus == VCLockStatus.LockedHere;
                bool modified              = assetStatus.fileStatus == VCFileStatus.Modified;
                bool localOnly             = assetStatus.localOnly;
                bool deleted        = assetStatus.fileStatus == VCFileStatus.Deleted;
                bool added          = assetStatus.fileStatus == VCFileStatus.Added;
                bool unversioned    = assetStatus.fileStatus == VCFileStatus.Unversioned;
                bool ignored        = assetStatus.fileStatus == VCFileStatus.Ignored;
                bool replaced       = assetStatus.fileStatus == VCFileStatus.Replaced;
                bool lockedByOther  = assetStatus.lockStatus == VCLockStatus.LockedOther;
                bool managedByRep   = VCUtility.ManagedByRepository(assetStatus);
                bool haveControl    = VCUtility.HaveAssetControl(assetStatus);
                bool haveLock       = VCUtility.HaveVCLock(assetStatus);
                bool allowLocalEdit = assetStatus.LocalEditAllowed();
                bool pending        = assetStatus.reflectionLevel == VCReflectionLevel.Pending;
                bool mergeinfo      = assetStatus.property == VCProperty.Modified;
                bool conflicted     = assetStatus.fileStatus == VCFileStatus.Conflicted;
                bool hasChangeSet   = !ComposedString.IsNullOrEmpty(assetStatus.changelist);

                bool showAdd    = !pending && !ignored && unversioned;
                bool showOpen   = !pending && !showAdd && !added && !haveLock && !deleted && !isFolder && !mergableAsset && ((!lockedByOther && !localOnly) || allowLocalEdit);
                bool showDiff   = !pending && !ignored && !deleted && modifiedDiffableAsset && managedByRep;
                bool showCommit = !pending && !ignored && !allowLocalEdit && !localOnly && (haveLock || added || deleted || modifiedDiffableAsset || modifiedMeta || mergeinfo);
                bool showRevert = !pending && !ignored && !unversioned &&
                                  (haveControl || modified || added || deleted || replaced || modifiedDiffableAsset || modifiedMeta || lockedMeta || mergeinfo);
                bool showDelete           = !pending && !ignored && !deleted && !lockedByOther;
                bool showOpenLocal        = !pending && !ignored && !deleted && !isFolder && !allowLocalEdit && !unversioned && !added && !haveLock && !mergableAsset && !localOnly;
                bool showUnlock           = !pending && !ignored && !allowLocalEdit && haveLock;
                bool showUpdate           = !pending && !ignored && !added && managedByRep && instance != null;
                bool showUseTheirs        = !pending && !ignored && conflicted;
                bool showUseMine          = !pending && !ignored && conflicted;
                bool showMerge            = !pending && !ignored && conflicted && mergableAsset;
                bool showAddChangeList    = !pending && !ignored && !unversioned;
                bool showRemoveChangeList = !pending && !ignored && hasChangeSet;

                ValidActions validActions = 0;
                if (showAdd)
                {
                    validActions |= ValidActions.Add;
                }
                if (showOpen)
                {
                    validActions |= ValidActions.Open;
                }
                if (showDiff)
                {
                    validActions |= ValidActions.Diff;
                }
                if (showCommit)
                {
                    validActions |= ValidActions.Commit;
                }
                if (showRevert)
                {
                    validActions |= ValidActions.Revert;
                }
                if (showDelete)
                {
                    validActions |= ValidActions.Delete;
                }
                if (showOpenLocal)
                {
                    validActions |= ValidActions.OpenLocal;
                }
                if (showUnlock)
                {
                    validActions |= ValidActions.Unlock;
                }
                if (showUpdate)
                {
                    validActions |= ValidActions.Update;
                }
                if (showUseTheirs)
                {
                    validActions |= ValidActions.UseTheirs;
                }
                if (showUseMine)
                {
                    validActions |= ValidActions.UseMine;
                }
                if (showMerge)
                {
                    validActions |= ValidActions.Merge;
                }
                if (showAddChangeList)
                {
                    validActions |= ValidActions.AddChangeList;
                }
                if (showRemoveChangeList)
                {
                    validActions |= ValidActions.RemoveChangeList;
                }

                return(validActions);
            }
        }