public static void run()
        {
            // ADD ZNET ERROR HANDLING AND REMOVE OBJECT IF

            // force exit
            if (forceExitNextIteration)
            {
                forceExitNextIteration = false;
                resetObjectInfo();
                isActive = false;
                return;
            }


            // CHECK FOR BUILD MODE
            if (isInBuildMode())
            {
                if (isActive)
                {
                    exitMode();
                    resetObjectTransform();
                }
                return;
            }

            // CHECK FOR ABM
            if (ABM.isActive)
            {
                if (isActive)
                {
                    exitMode();
                    resetObjectTransform();
                }

                return;
            }

            if (!isActive)
            {
                if (Input.GetKeyDown(Settings.getHotkey("enterAdvancedEditingMode")))
                {
                    if (checkForObject())
                    {
                        startMode();
                    }
                    return;
                }
            }

            if (Input.GetKeyDown(Settings.getHotkey("abortAndExitAdvancedEditingMode")))
            {
                exitMode();
                resetObjectTransform();
            }

            if (isActive)
            {
                // If object is not in exsistence anymore
                if (hitPieceStillExsists())
                {
                    // Try to prevent znet error, relatively untested yet if this is any solution.
                    // ghetto solution, will be improved in future version if it proofs to be effective.
                    try
                    {
                        ZNetView component1 = HitPiece.GetComponent <ZNetView>();
                        if ((UnityEngine.Object)component1 == (UnityEngine.Object)null)
                        {
                            Debug.Log("AEM: Error, network object empty. Code: 2.");
                            exitMode();
                            return;
                        }
                    }
                    catch (Exception e) {
                        Debug.Log("AEM: Error, network object empty. Code: 3.");
                        exitMode();
                    }

                    AEM.isRunning();
                    listenToHotKeysAndDoWork();
                }
                else
                {
                    exitMode();
                }
            }
        }
Example #2
0
        public static void run()
        {
            // force exit
            if (forceExitNextIteration)
            {
                forceExitNextIteration = false;
                resetObjectInfo();
                isActive = false;
                return;
            }

            // CHECK FOR BUILD MODE
            if (isInBuildMode())
            {
                if (isActive)
                {
                    exitMode();
                    resetObjectTransform();
                }
                return;
            }

            // CHECK FOR ABM
            if (ABM.isActive)
            {
                exitMode();
                resetObjectTransform();
                return;
            }

            if (!isActive)
            {
                if (Input.GetKeyDown(Settings.getHotkey("enterAdvancedEditingMode")))
                {
                    if (checkForObject())
                    {
                        startMode();
                    }
                    return;
                }
            }

            if (Input.GetKeyDown(Settings.getHotkey("abortAndExitAdvancedEditingMode")))
            {
                exitMode();
                resetObjectTransform();
            }

            if (isActive)
            {
                // If object is not in exsistence anymore
                if (hitPieceStillExsists())
                {
                    AEM.isRunning();
                    listenToHotKeysAndDoWork();
                }
                else
                {
                    exitMode();
                }
            }
        }