Inheritance: MonoBehaviour
Ejemplo n.º 1
0
    void Awake()
    {
        instance = this;

        allFlowFields    = FindObjectsOfType <FlowField>();
        heartbeatCounter = 1;
    }
Ejemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (playerDistanceComponent != null)
        {
            if (FlowManager.GetGameState() == GameState.InGame)
            {
                foreach (PlanetDefiner planet in planets.planets)
                {
                    if (!isReachedArray[idx])
                    {
                        if (playerDistanceComponent.neutrinoPercurredDistance >= planet.planetDistance)
                        {
                            scoreText.text = LocalizationData.GetDescription(extraTextBefore)
                                             + " "
                                             + LocalizationData.GetDescription(planet.planetName)
                                             + LocalizationData.GetDescription(extraTextAfter);

                            isReachedArray[idx] = true;
                            StartCoroutine(awaitFunc());
                        }
                    }
                    idx++;
                }
                idx = 0;
            }
        }
    }
Ejemplo n.º 3
0
 public int Audit(CheckObject entity)
 {
     try
     {
         FlowManager flowMgr    = FlowManager.Instance();
         FlowEngine  flowEngine = flowMgr.Load(entity.Id);
         if (flowEngine == null)
         {
             return(-1);
         }
         if (entity.AuditType == (int)AuditType.Passed)
         {
             flowMgr.Audit(flowEngine, (AuditType)entity.AuditType, entity.AuditDesc, entity.UserId);
         }
         else
         {
             flowMgr.Returned(flowEngine, (AuditType)entity.AuditType, entity.AuditDesc, entity.UserId);
             ProjectEntity project = DataHelper.GetDataItem <ProjectEntity>("Usp_Project_Get", new { Id = entity.Id });
             project.I_State = 165;
             DataHelper.ExecuteNonQuery("Usp_Project_Insert", project);
         }
         WriteLog("流程审核", flowEngine);
         flowMgr.FlowSave(flowEngine);
         return(1);
     }
     catch (Exception ex)
     {
         return(-1);
     }
 }
Ejemplo n.º 4
0
 void OnDestroy()
 {
     if (gameInstance != null)
     {
         gameInstance = null;
     }
 }
        public async Task <IActionResult> Create(InitFlowTransitionModel model)
        {
            var result = await FlowManager.InitFlowTransitionAsync(model);

            HandleFlowResult(result);
            return(RedirectToAction(nameof(Create), new { flowStateId = model.SourceId }));
        }
Ejemplo n.º 6
0
 public void ActivateCreditsCanvas()
 {
     FlowManager.SetFlowState(GameState.InCredits);
     ActiveCanvas.SetActive(false);
     CreditsCanvas.SetActive(true);
     ActiveCanvas = CreditsCanvas;
 }
Ejemplo n.º 7
0
        public void OperationMultiplierTest()
        {
            Task.Run(async() =>
            {
                //create tree
                Initiator root = new Initiator();
                root.NextStep  = new OperationMultiplier()
                {
                    NextStep = new Terminator()
                };

                //create data
                TestData data = new TestData()
                {
                    A = 5,
                    B = 10
                };

                FlowManager man = new FlowManager();
                bool result     = await man.Execute(root, data);

                Assert.IsTrue(result);
                Assert.AreEqual(50, data.Result);
                Assert.AreEqual(3, man.ProcessedCounter);
            }).GetAwaiter().GetResult();
        }
Ejemplo n.º 8
0
 private static void ExceptionSave()
 {
     for (int i = 0; i < FlowManager.Projects.Count; i++)
     {
         FlowManager.SaveProject(FlowManager.Projects[i]);
     }
 }
    // PUBLIC MODIFIERS

    public void Awake()
    {
        // if this is the first instance, make this the singleton
        if (_instance == null)
        {
            _instance = this;
            DontDestroyOnLoad(_instance);
        }
        else
        {
            // destroy other instances that are not the already existing singleton
            if (this != _instance)
            {
                // but save their inspector set parameters
                _instance.scene_animator    = this.scene_animator;
                _instance.native_messenger  = this.native_messenger;
                _instance.room_messenger    = this.room_messenger;
                _instance.room_buttons_page = this.room_buttons_page;
                _instance.outro_page        = this.outro_page;

                // destroy
                Destroy(this.gameObject);
            }
        }

        Initialize();
    }
    public static void reactToBlock()
    {
        switch (Data.Map.data[(int)posXY.x, (int)posXY.y])
        {
        case (int)Blocks.NORMAL:
            stopMoving();
            break;

        case (int)Blocks.ICE:
            break;

        case (int)Blocks.FALLING:
            Data.Map.objects [(int)posXY.x, (int)posXY.y].GetComponent <BlockScript> ().setFalling();
            break;

        case (int)Blocks.EXIT:
            stopMoving();
            UnlitAlphaDecrease.setWin(true);
            FlowManager.advanceLevel();
            break;

        case (int)Blocks.BEGINNING:
            break;
        }
    }
Ejemplo n.º 11
0
        static void Main(string[] args)
        {
            bool ret;

            System.Threading.Mutex mutex = new System.Threading.Mutex(true, Application.ProductName, out ret);
            if (ret)
            {
                if (IPAddressSelector.Instance().ShowDialog() == DialogResult.OK)
                {
                    Application.EnableVisualStyles();
                    System.Windows.Forms.Application.DoEvents();

                    Application.ApplicationExit += Application_ApplicationExit;
                    Application.ThreadException += Application_ThreadException;
                    Application.ThreadExit      += Application_ThreadExit;
                    AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

                    LoginForm form = new LoginForm();
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        FlowManager.StartFlowManager();
                    }
                    mutex.ReleaseMutex();
                }
            }
            else
            {
                MessageBox.Show(null, "有一个和本程序相同的应用程序已经在运行,请不要同时运行多个本程序。\n\n这个程序即将退出。", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //   提示信息,可以删除。
                Application.Exit();//退出程序
            }
        }
Ejemplo n.º 12
0
 public void SaveProject()
 {
     if (this.treeView.SelectedNode is FlowProjectNode)
     {
         FlowManager.SaveProject((this.treeView.SelectedNode as FlowProjectNode).Project);
     }
 }
Ejemplo n.º 13
0
 public void DeleteView()
 {
     if ((this.treeView.SelectedNode is SCADAViewNode) && (MessageBox.Show("是否要删除" + this.treeView.SelectedNode.Text + "视图?", "删除提示", MessageBoxButtons.YesNo) == DialogResult.Yes))
     {
         try
         {
             SCADAViewNode   selectedNode = (SCADAViewNode)this.treeView.SelectedNode;
             FlowProjectNode parent       = (FlowProjectNode)this.treeView.SelectedNode.Parent;
             parent.Project.GraphList.Remove(selectedNode.GraphSite);
             parent.Nodes.Remove(selectedNode);
             for (int i = 0; i < this.mediator.DockPanel.Documents.Count <DockContent>(); i++)
             {
                 if ((this.mediator.DockPanel.Documents[i] is WorkForm) && ((this.mediator.DockPanel.Documents[i] as WorkForm) == selectedNode.View))
                 {
                     this.mediator.DockPanel.Documents[i].Hide();
                     this.mediator.DockPanel.Documents[i].Dispose();
                     this.mediator.DockPanel.Documents[i] = null;
                 }
             }
             FlowManager.AddLogToMainLog("删除视图成功!" + parent.Text + "//" + selectedNode.Text);
         }
         catch (Exception exception)
         {
             FlowManager.AddLogToMainLog("删除视图失败!" + exception.InnerException);
         }
     }
 }
Ejemplo n.º 14
0
    // Update is called once per frame
    void Update()
    {
        if (playerPercurredDistance != null)
        {
            float distancePercurred = playerPercurredDistance.getPercurredDistance();



            if (FlowManager.GetGameState() == GameState.InGame)
            {
                foreach (PlanetDefiner planet in planets.planets)
                {
                    if (!isAppearedYet[idx])
                    {
                        // The planets spawns "beforeDistance" UA before reaching it
                        if (distancePercurred >= planet.planetDistance - beforeDistance)
                        {
                            spawnPlanet(idx);
                            isAppearedYet[idx] = true;
                        }
                    }
                    idx++;
                }
                idx = 0;
            }
        }
    }
Ejemplo n.º 15
0
        private void ExecutePackageFlow()
        {
            if (mainFlowContent.Content == null)
            {
                return;
            }

            SaveDiagram();

            packageIsRunning = true;
            FlowManager flowManager = new FlowManager(this.Connections, this.moduleLoader.Modules, this.Package);

            FlowDesign.FlowDesigner mainFlowDesigner = mainFlowContent.Content as FlowDesign.FlowDesigner;
            mainFlowDesigner.MyDesigner.ExecuteFlow(flowManager);
            flowManager.DesignerItemStart += flowManager_ProgressReport;
            flowManager.ProgressReport    += flowManager_ProgressReport;
            flowManager.DesignerItemStop  += flowManager_ProgressReport;
            flowManager.RunCompleted      += flowManager_RunCompleted;
            AdditionalInfosArea.Height     = new GridLength(120);

            RunLog runLog = new RunLog();

            this.Package.ParentProject.RunLogs.Add(runLog);
            flowManager.Run(runLog);
        }
Ejemplo n.º 16
0
        public void TestForError()
        {
            Task.Run(async() =>
            {
                //create tree
                Initiator root = new Initiator();
                root.NextStep  = new OperationForcedError()
                {
                    NextStep = new Terminator()
                };

                //create data
                TestData data = new TestData()
                {
                    A = 5,
                    B = 10
                };

                FlowManager man = new FlowManager();
                bool result     = await man.Execute(root, data);

                Assert.IsFalse(result);
                Assert.AreEqual(man.CurrentStep.Errors.Count, 1);
            }).GetAwaiter().GetResult();
        }
Ejemplo n.º 17
0
 public void ActivateMainCanvas()
 {
     FlowManager.SetFlowState(GameState.MainMenu);
     ActiveCanvas.SetActive(false);
     MainCanvas.SetActive(true);
     ActiveCanvas = MainCanvas;
 }
Ejemplo n.º 18
0
 public void ActivateDex()
 {
     FlowManager.SetFlowState(GameState.InDex);
     ActiveCanvas.SetActive(false);
     DexCanvas.SetActive(true);
     ActiveCanvas = DexCanvas;
 }
Ejemplo n.º 19
0
 public void Awake()
 {
     flowManager  = GetComponent <FlowManager>();
     levelManager = GetComponent <LevelManager>();
     scoreManager = GetComponent <ScoreManager>();
     menuManager  = GetComponent <MenuManager>();
 }
Ejemplo n.º 20
0
    private void OnTriggerStay2D(Collider2D other)
    {
        #if UNITY_EDITOR
        if (GameObject.FindGameObjectWithTag("DebugManager").GetComponent <DebugManager>().isInGodMode)
        {
            return;
        }
        #endif

        FlavourDefinition otherFlavour = other.gameObject.GetComponent <FlavourDefinition>();
        if (otherFlavour != null)
        {
            if (otherFlavour.flavour == CurrentFlavour)
            {
                Destroy(other.gameObject);
                FlowManager.SetFlowState(GameState.GameOver);
                m_GameOverFlavorMessage.SetFlavour(CurrentFlavour);
                if (ExplosionAnimation != null)
                {
                    ExplosionAnimation.SetActive(true);
                    StartCoroutine(DisableFx());
                }
                this.gameObject.GetComponent <SpriteRenderer>().enabled = false;
                this.gameObject.GetComponent <Collider2D>().enabled     = false;
            }
        }
    }
Ejemplo n.º 21
0
        private void ucBtLogin_BtnClick(object sender, EventArgs e)
        {
            if (this.tbUser.Text.Trim() == "")
            {
                MessageBox.Show(this, "请输入账户", "账户输入");
                return;
            }
            if (this.tbPassword.Text.Trim() == "")
            {
                MessageBox.Show(this, "请输入密码", "密码输入");
                return;
            }
            if (this.txtIP.Text.Trim() == "")
            {
                MessageBox.Show(this, "请输入服务器的IP地址", "IP提示");
                return;
            }
            SetInfo("正在尝试连接服务器....");
            IPAddress ip = IPAddress.Any;

            if (IPAddress.TryParse(this.txtIP.Text.Trim(), out ip))
            {
                FlowManager.InitTcpClient(this.txtIP.Text);
                FlowManager.TcpClient.OnConnectedServer += TcpClient_OnConnectedServer;
                FlowManager.TcpClient.OnUserLogined     += TcpClient_OnUserLogined;
                FlowManager.TcpClient.OnConnectTimeout  += TcpClient_OnConnectTimeout;
                FlowManager.LoginManager(this.tbUser.Text.Trim(), this.tbPassword.Text.Trim());
            }
            else
            {
                MessageBox.Show(this, "请输入正确服务器的IP地址", "IP提示");
            }
        }
Ejemplo n.º 22
0
    private void OnDestroy()
    {
        StopAllCoroutines();

        if (m_LoadingScreen != null)
        {
            Destroy(m_LoadingScreen);
            m_LoadingScreen = null;
        }
        if (m_Overlay != null)
        {
            Destroy(m_Overlay);
            m_Overlay = null;
        }

        m_Instance         = null;
        m_ActionController = null;
        m_OpenedViews.Clear();
        m_OpenedViews = null;
        m_ClosedViews.Clear();
        m_ClosedViews = null;
        m_OpeningView = null;
        m_ClosingViews.Clear();
        m_ClosingViews      = null;
        m_GainingFocusView  = null;
        m_LosingFocusView   = null;
        m_CurrentActionData = null;
        m_QueuedActions.Clear();
        m_QueuedActions = null;
    }
    public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        if (stateInfo.normalizedTime >= 0.9f && !said_message)
        {
            FlowManager.Instance.room_messenger.Message("You've got mail! Let's send a reply...", 3f);

            // bring up the options buttons and display the help text
            FlowManager.Instance.room_buttons_page.TransitionIn();
            FlowManager.Instance.room_buttons_page.OpenHelpPageDelayed(1.5f);

            said_message = true;
        }
        if (FlowManager.OutputCorrect() && next_timer < 0)
        {
            // delay before going to next state
            next_timer = next_time_max;
        }

        if (next_timer >= 0)
        {
            next_timer -= Time.deltaTime;
            if (next_timer <= 0)
            {
                // delay over, go to next state
                FlowManager.AnimatorNextScene();
            }
        }
    }
Ejemplo n.º 24
0
 private void 发布工程ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (FrmDialog.ShowDialog(this, "是否要发布选中的流程", "发布流程提示", true) == DialogResult.OK)
     {
         FlowManager.PublishProject();
     }
 }
Ejemplo n.º 25
0
    private void Awake()
    {
        if (m_Instance == null)
        {
            m_Instance = this;
        }

        if (m_ActionController == null)
        {
            m_ActionController = new FlowDataController();
        }

        if (m_LoadingScreen == null)
        {
            GameObject loadingScreenPrefab = Resources.Load(LOADING_PREFAB_PATH) as GameObject;
            if (loadingScreenPrefab != null)
            {
                m_LoadingScreen = GameObject.Instantiate(loadingScreenPrefab) as GameObject;
                m_LoadingScreen.transform.parent = transform;
                m_LoadingScreen.SetActive(false);
            }
        }

        if (m_Overlay == null)
        {
            GameObject overlayPrefab = Resources.Load(OVERLAY_PREFAB_PATH) as GameObject;
            if (overlayPrefab != null)
            {
                m_Overlay = GameObject.Instantiate(overlayPrefab) as GameObject;
                m_Overlay.transform.parent = transform;
                m_Overlay.SetActive(false);
            }
        }
    }
 public void Update()
 {
     if (FlowManager.InputContinue() && !base.IsGoingOut())
     {
         ButtonContinue();
     }
 }
Ejemplo n.º 27
0
 private void 保存工程ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < FlowManager.Projects.Count; i++)
     {
         FlowManager.SaveProject(FlowManager.Projects[i]);
     }
 }
Ejemplo n.º 28
0
        public void ExecuteFlow(FlowManager flowManager)
        {
            SelectionService.ClearSelection();

            flowManager.DesignerItemStart += flowManager_DesignerItemStart;
            flowManager.DesignerItemStop  += flowManager_DesignerItemStop;
            flowManager.ProgressReport    += flowManager_ProgressReport;
        }
Ejemplo n.º 29
0
 private void Awake()
 {
     if (Instance != null && Instance != this)
     {
         Destroy(gameObject);
     }
     Instance = this;
 }
Ejemplo n.º 30
0
    protected virtual void Step2(FlowManager fm)
    {
        int i = (int)fm.getData("i");

        Console.WriteLine("Step2_" + i);

        fm.EndLoop();
    }
Ejemplo n.º 31
0
    void Awake () {
		Instance = this;
	}
Ejemplo n.º 32
0
    private void OnDestroy()
    {
        StopAllCoroutines();

        if (m_LoadingScreen != null)
        {
            Destroy(m_LoadingScreen);
            m_LoadingScreen = null;
        }
        if (m_Overlay != null)
        {
            Destroy(m_Overlay);
            m_Overlay = null;
        }

        m_Instance = null;
        m_ActionController = null;
        m_OpenedViews.Clear();
        m_OpenedViews = null;
        m_ClosedViews.Clear();
        m_ClosedViews = null;
        m_OpeningView = null;
        m_ClosingViews.Clear();
        m_ClosingViews = null;
        m_GainingFocusView = null;
        m_LosingFocusView = null;
        m_CurrentActionData = null;
        m_QueuedActions.Clear();
        m_QueuedActions = null;
    }
Ejemplo n.º 33
0
    private void Awake()
    {
        if (m_Instance == null)
        {
            m_Instance = this;
        }

        if (m_ActionController == null)
        {
            m_ActionController = new FlowDataController();
        }

        if (m_LoadingScreen == null)
        {
            GameObject loadingScreenPrefab = Resources.Load(LOADING_PREFAB_PATH) as GameObject;
            if (loadingScreenPrefab != null)
            {
                m_LoadingScreen = GameObject.Instantiate(loadingScreenPrefab) as GameObject;
                m_LoadingScreen.transform.parent = transform;
                m_LoadingScreen.SetActive(false);
            }
        }

        if (m_Overlay == null)
        {
            GameObject overlayPrefab = Resources.Load(OVERLAY_PREFAB_PATH) as GameObject;
            if (overlayPrefab != null)
            {
                m_Overlay = GameObject.Instantiate(overlayPrefab) as GameObject;
                m_Overlay.transform.parent = transform;
                m_Overlay.SetActive(false);
            }
        }
    }