コード例 #1
0
 public static void PortalLinkSelected()
 {
     UIPortalMenu.Activate(LevelEditor.CreateLevelData());
     animator.SetTrigger("showPortal");
     animator.ResetTrigger("portalLinkSelected");
     animator.SetTrigger("portalLinkSelected");
     LevelEditor.editorMode = LevelEditor.EditorMode.edit;
 }
コード例 #2
0
 private void Start()
 {
     menuOpen = false;
     if (_instance == null)
     {
         _instance      = this;
         animator       = GetComponent <Animator>();
         preferenceData = LevelEditor.CreateLevelData();
     }
 }
コード例 #3
0
    // activates the properties menu that corresponds to the current selected object
    public static UIPreferenceMenu ShowMenu()
    {
        LevelObject.ObjectType type = LevelEditor.selectedObject.objectType;
        Debug.Log("type " + type + " - " + _instance);
        if (_instance != null)
        {
            UndoManager.AddUndoPoint();
            switch (type)
            {
            case LevelObject.ObjectType.turret:
                UITurretMenu.Activate(LevelEditor.CreateLevelData());
                UIPreferenceMenu.onPreferenceChange.Invoke(_instance.turretMenu);
                animator.ResetTrigger("showTurret");
                animator.ResetTrigger("hideTurret");
                animator.SetTrigger("showTurret");
                Debug.Log("treeehehee " + _instance.turretMenu);
                menuOpen       = true;
                openedMenuType = LevelObject.ObjectType.turret;
                return(_instance.turretMenu);

            case LevelObject.ObjectType.portal:
                UIPortalMenu.Activate(LevelEditor.CreateLevelData());
                UIPreferenceMenu.onPreferenceChange.Invoke(_instance.portalMenu);
                animator.ResetTrigger("showPortal");
                animator.SetTrigger("showPortal");
                menuOpen       = true;
                openedMenuType = LevelObject.ObjectType.portal;
                return(_instance.portalMenu);

            case LevelObject.ObjectType.attractor:
                UIAttractorMenu.Activate(LevelEditor.CreateLevelData());
                UIPreferenceMenu.onPreferenceChange.Invoke(_instance.attractorMenu);
                animator.ResetTrigger("showAttractor");
                animator.SetTrigger("showAttractor");
                menuOpen       = true;
                openedMenuType = LevelObject.ObjectType.attractor;
                return(_instance.attractorMenu);

            case LevelObject.ObjectType.speedStrip:
                UISpeedStripMenu.Activate(LevelEditor.CreateLevelData());
                UIPreferenceMenu.onPreferenceChange.Invoke(_instance.speedStripMenu);
                animator.ResetTrigger("showSpeedStrip");
                animator.ResetTrigger("hideSpeedStrip");
                animator.SetTrigger("showSpeedStrip");
                menuOpen       = true;
                openedMenuType = LevelObject.ObjectType.speedStrip;
                return(_instance.speedStripMenu);

            case LevelObject.ObjectType.bouncer:
                UIBouncerMenu.Activate(LevelEditor.CreateLevelData());
                UIPreferenceMenu.onPreferenceChange.Invoke(_instance.bouncerMenu);
                animator.ResetTrigger("showBouncer");
                animator.SetTrigger("showBouncer");
                menuOpen       = true;
                openedMenuType = LevelObject.ObjectType.bouncer;
                return(_instance.bouncerMenu);

            case LevelObject.ObjectType.finish:
                return(_instance.finishMenu);

            case LevelObject.ObjectType.spawn:
                return(_instance.spawnMenu);
            }
            Debug.Log("HERE");
        }
        return(null);
    }