private Stage CreateStage(XElement xml) { Stage stage = new Stage(xml); switch (stage.Type) { case "Data": stage = new DataItem(xml); break; case "Action": stage = new ActionStage(xml); break; case "Code": stage = new CodeStage(xml); break; case "Exception": stage = new ExceptionStage(xml); break; case "WaitStart": stage = new WaitStartStage(xml); break; case "WaitEnd": stage = new WaitEndStage(xml); break; case "Start": stage = new StartStage(xml); break; case "End": stage = new EndStage(xml); break; case "Process": stage = new SubProcessStage(xml); break; case "Navigate": stage = new NavigateStage(xml); break; case "Read": stage = new ReadStage(xml); break; case "Write": stage = new WriteStage(xml); break; case "SubSheet": stage = new SubPageStage(xml); break; } return(stage); }
private static ActionStage ParseActionStage(Dictionary <string, object> data) { ActionStage stage = new ActionStage(); if (data.ContainsKey("movable")) { stage.Movable = bool.Parse(data["movable"].ToString()); } if (data.ContainsKey("scriptId")) { stage.ScriptId = int.Parse(data["scriptId"].ToString()); } if (data.ContainsKey("AnimSeq")) { stage.AnimationList = new List <AnimSeq>(); foreach (var animData in (List <Dictionary <string, object> >)data["AnimSeq"]) { stage.AnimationList.Add(ParseAnimSeq(animData)); } } return(stage); }
public override bool Update() { ActionStage newState = GetCurrentStage(); if (newState != m_PreviousStage && newState == ActionStage.Charging) { // we've just started to charge across the screen! Anyone currently touching us gets hit SimulateCollisionWithNearbyFoes(); m_Movement.StartForwardCharge(Description.MoveSpeed, Description.DurationSeconds - Description.ExecTimeSeconds); } m_PreviousStage = newState; return(newState != ActionStage.Complete && !m_WasStunned); }
public override bool Start() { m_PreviousStage = ActionStage.Windup; m_Movement = m_Parent.GetComponent <ServerCharacterMovement>(); if (m_Data.TargetIds != null && m_Data.TargetIds.Length > 0) { NetworkObject initialTarget = NetworkSpawnManager.SpawnedObjects[m_Data.TargetIds[0]]; if (initialTarget) { // snap to face our target! This is the direction we'll attack in m_Parent.transform.LookAt(initialTarget.transform.position); } } m_Parent.NetState.RecvDoActionClientRPC(Data); return(true); }
/// <summary> /// This could only be called by the current controller /// </summary> /// <param name="s">Next stage</param> public void ChangeActionStage(ActionStage s) { actionStage = s; }
private void _ToAction() { var stage = new ActionStage(_Teams, _CommonSkillSet); stage.DoneEvent += () => { _ToStrategy(_Teams); }; stage.EliminateEvent += _EliminateTeam; _StageMachine.Push(stage); }
private void nextStage() { if (currentStage >= stages.Length || stages[currentStage]==null)currentStage=totalStages; //quickfix for actionstages if (totalStages==currentStage){ Invoke("letsMoveCameraBack",1.0f); CameraFade.StartAlphaFade( Color.black, false, 3f, 0.0f, () => levelHandler.beginCloseBody() ); bSpawnNextStage = false; return; } if (needTobeVisible[currentStage]!=null && needTobeVisible[currentStage]!=lastThingVisible) { bStageBuilding = true; StartCoroutine(hideBodyPartsNotUsedForActionStage(needTobeVisible[currentStage],shouldBlackOutIntoScene[currentStage])); return; //this will wait until its ready to spawn } if (cameraCenterLocations[currentStage]!=null && bHasReachedDestination==false){ if (bMovingCamera==false){ bMovingCamera = true; if (instanlyMoveTo[currentStage]==true) camMover.moveCameraToInstantly(cameraCenterLocations[currentStage]); else camMover.moveCameraTo(cameraCenterLocations[currentStage]); } return; } GameObject astage = (GameObject)Instantiate(stages[currentStage],enemySpawnArea.position,stages[currentStage].transform.rotation); ActionStage actionStage = astage.GetComponent<ActionStage>(); actionStage.setActionStageManager(this); if (shouldShakeOnSpawn[currentStage]==true){ cameraShake.shakeStrong(.5f); } //when its spawned its also important to put a little text info for the user //HERES THE NPC TEXT showNPCText(stageNPCDialog[currentStage]); actionStage.delayTimer = delayTimer[currentStage]; //here i check the tooltoHint at if (actionStage.toolToHintAt !=-1) { operatingUIEvents.hintUseTool(actionStage.toolToHintAt); } currentStage++; bSpawnNextStage = false; lastActionStage = actionStage; }