void Start() { if (ChangeableVariables.levelWeAreIn == "3x3_1" || ChangeableVariables.levelWeAreIn == "3x3_2") { tL = GameObject.Find("Tutorial").GetComponent <TutorialLevel> (); } // fire an event to change shapes directions (how we control the shape) - "switch feature" // because we can rotate the camera before we decide to switch shapes // and because the new shape each time takes the directions that used to be // we need to change them SpawnCubes.switchMovements += ChangeDirections; scCtrl = GameObject.Find("Platform").GetComponent <ScoreController> (); dS = transform.GetComponent <DisablingScripts> (); zOc = transform.GetComponentInChildren <ZeroOverlappingCases> (); currentState = PossibleStates.TurnOff; cC = GetComponentsInChildren <CubeController> (); spawner = GameObject.FindGameObjectWithTag("Spawner"); sC = (SpawnCubes)spawner.GetComponent(typeof(SpawnCubes)); mC = GetComponent <MovingController> (); directions = GameObject.FindGameObjectWithTag("Directions"); dfc = (DirectionsFollowingCamera)directions.GetComponent(typeof(DirectionsFollowingCamera)); }
public void StartTutorialLevel(TutorialLevel tutorialLevel) { if (IsValidString(tutorialLevel.StartIds)) { MessageController.Instance.AddMessage(tutorialLevel.start_time, Localization.instance.Get(tutorialLevel.StartIds)); } }
TutorialLevel CreateTutorialLevel7() { string narratingText = "It's time to kick him out of the company\nLure the BOSS to Resignation Letter"; TutorialLevel tutorial = new TutorialLevel(7); tutorial.narratingText = narratingText; return(tutorial); }
TutorialLevel CreateTutorialLevel6() { string narratingText = "Now pick up the Great Axe and press 'F' to attack the boss. \nUse your mouse to aim"; TutorialLevel tutorial = new TutorialLevel(6); tutorial.narratingText = narratingText; return(tutorial); }
TutorialLevel CreateTutorialLevel5() { string narratingText = "Now pick up the book and press 'SPACE' to throw at the boss"; TutorialLevel tutorial = new TutorialLevel(5); tutorial.narratingText = narratingText; return(tutorial); }
TutorialLevel CreateTutorialLevel4() { string narratingText = "Now pick up the banana and press 'B' to put it on the floor\n Then lure your boss into the bana peel"; TutorialLevel tutorial = new TutorialLevel(4); tutorial.narratingText = narratingText; return(tutorial); }
TutorialLevel CreateTutorialLevel3() { string narratingText = "Great! You can also move to a working zone to reduce your workload. Now \nmove to the green area. Remember the workzone has duration and cooldown"; TutorialLevel tutorial = new TutorialLevel(3); tutorial.narratingText = narratingText; return(tutorial); }
TutorialLevel CreateTutorialLevel2() { string narratingText = "Now pick up the pen to reduce your work load!"; TutorialLevel tutorial = new TutorialLevel(2); tutorial.narratingText = narratingText; return(tutorial); }
TutorialLevel CreateTutorialLevel1() { string narratingText = "Use A, W, S, D to move around the map"; TutorialLevel tutorial = new TutorialLevel(1); tutorial.narratingText = narratingText; return(tutorial); }
public void FinishTutorialLevel(TutorialLevel tutorialLevel) { if (IsValidString(tutorialLevel.StartIds)) { MessageController.Instance.CloseMessage(Localization.instance.Get(tutorialLevel.StartIds)); } if (IsValidString(tutorialLevel.FinishIds)) { MessageController.Instance.AddMessage(tutorialLevel.finish_time, Localization.instance.Get(tutorialLevel.FinishIds)); } }
static void Main(string[] args) { BuilderDirector builderDirector = new BuilderDirector(); Builder levelBuilder = new TutorialLevel(); builderDirector.createLevel(levelBuilder); levelBuilder.showLevel(); Console.ReadKey(); }
void CreateTutorialLevel() { TutorialLevel tutorial1 = CreateTutorialLevel1(); TutorialLevel tutorial2 = CreateTutorialLevel2(); TutorialLevel tutorial3 = CreateTutorialLevel3(); TutorialLevel tutorial4 = CreateTutorialLevel4(); TutorialLevel tutorial5 = CreateTutorialLevel5(); TutorialLevel tutorial6 = CreateTutorialLevel6(); TutorialLevel tutorial7 = CreateTutorialLevel7(); allLevels.Add(tutorial1); allLevels.Add(tutorial2); allLevels.Add(tutorial3); allLevels.Add(tutorial4); allLevels.Add(tutorial5); allLevels.Add(tutorial6); allLevels.Add(tutorial7); }
public bool TryFinishTutorialLevel(EnumTutorial tutorialId) { _inTutorialFlag = false; isTutorialHpOrEnergy = false; EnumTutorialState state = PlayerInfo.Instance.GetTutorialState(tutorialId); if (state != EnumTutorialState.Finished) { TutorialLevel tutorialLevel = GetTutorialLevel(tutorialId); PlayerInfo.Instance.ChangeTutorialState(tutorialId, EnumTutorialState.Finished); if (tutorialLevel.only_once) { PlayerInfo.Instance.ChangeTutorialState(tutorialId, EnumTutorialState.Finished); } FinishTutorialLevel(tutorialLevel); } return(true); }
public bool TryStartTutorialLevel(EnumTutorial tutorialId) { EnumTutorialState state = PlayerInfo.Instance.GetTutorialState(tutorialId); if (state == EnumTutorialState.Inactive) //if this tutorial is not active or finish, check if can start. { TutorialLevel tutorialLevel = GetTutorialLevel(tutorialId); EnumTutorialState preState = EnumTutorialState.Inactive; if (tutorialLevel.preId != EnumTutorial.None) { preState = PlayerInfo.Instance.GetTutorialState(tutorialLevel.preId); } else { preState = EnumTutorialState.Finished; } if (preState == EnumTutorialState.Finished) //if pre turiral have finish , start this tutorial { PlayerInfo.Instance.ChangeTutorialState(tutorialId, EnumTutorialState.Active); StartTutorialLevel(tutorialLevel); _inTutorialFlag = true; if (tutorialId == EnumTutorial.Battle_HealthPotion || tutorialId == EnumTutorial.Battle_EnergyPotion) { isTutorialHpOrEnergy = true; } return(true); } } return(false); }
public EnumTutorialState GetTutorialState(EnumTutorial tutorialId) { return(EnumTutorialState.Finished); EnumTutorialState tState = EnumTutorialState.Inactive; if (_tutorialState.ContainsKey(tutorialId)) { tState = _tutorialState[tutorialId]; } if (tutorialId == EnumTutorial.Battle_Skill1) { if (null != DataManager.Instance.GetSkillByKey(FC_KEY_BIND.ATTACK_2)) { if (GetLevelState(LevelManager.Singleton.CurrentLevelData.levelName) >= EnumLevelState.NEW_UNLOCK) { tState = EnumTutorialState.Finished; ChangeTutorialState(tutorialId, EnumTutorialState.Finished); } } } if (tutorialId == EnumTutorial.Battle_Skill2) { if (null != DataManager.Instance.GetSkillByKey(FC_KEY_BIND.ATTACK_3)) { if (GetLevelState(LevelManager.Singleton.CurrentLevelData.levelName) >= EnumLevelState.NEW_UNLOCK) { tState = EnumTutorialState.Finished; ChangeTutorialState(tutorialId, EnumTutorialState.Finished); } } } if (tutorialId == EnumTutorial.Town_Skill) { if (activeSkillList.Count >= 3) { tState = EnumTutorialState.Finished; ChangeTutorialState(tutorialId, EnumTutorialState.Finished); } } if (tState != EnumTutorialState.Finished) { TutorialTown tutorialTown = TutorialTownManager.Instance.GetTutorialTown(tutorialId); if (tutorialTown != null) { if (tutorialTown.only_once) { int tmpState = 0; if (tmpState == 2) { return(EnumTutorialState.Finished); } } } else { TutorialLevel tutorialLevel = TutorialManager.Instance.GetTutorialLevel(tutorialId); if (tutorialLevel != null) { if (tutorialLevel.only_once) { int tmpState = 0; if (tmpState == 2) { return(EnumTutorialState.Finished); } } } } } return(tState); }
void Start() { guiMain = Camera.main.GetComponent <GUIMain> (); shapesManager = GameObject.Find("ShapesManager"); sM = shapesManager.GetComponent <ShapesManager> (); tutorial = GameObject.Find("Tutorial"); tL = tutorial.GetComponent <TutorialLevel> (); // just for the first shape if (ChangeableVariables.levelWeAreIn == "3x3_1" && sM.activeShapes.Count < 1 && PlayerPrefs.GetString("FinidhedFirstTutorial") == "false") { statesList.Add(TutorialLevel.TutorialStates.RotateHorizontally); statesList.Add(TutorialLevel.TutorialStates.RotateVertically); statesList.Add(TutorialLevel.TutorialStates.Drag); statesList.Add(TutorialLevel.TutorialStates.DoubleTap); tL.currentState = statesList [numberOfTheState]; tL.CurrentTexture(); tL.NewPositionsOfTheVectors(); numberOfTheState++; weAccomplishedTutorial = false; } else { weAccomplishedTutorial = true; } SwapTexture(); currentState = StatesOfTheShape.Idle; sc = GameObject.Find("Platform").GetComponent <ScoreController> (); lS = GameObject.Find("Platform").GetComponent <LineScore> (); lS.activeObject = this.gameObject; actualRot = transform.GetComponentInChildren <ActualRotation> (); drc = transform.GetComponentsInChildren <DrawRaysCube> (); directions = GameObject.FindGameObjectWithTag("Directions"); dfc = (DirectionsFollowingCamera)directions.GetComponent(typeof(DirectionsFollowingCamera)); curSpeed = dfc.speedOfFalling; // get directions // each time we spawn a new shape we need to know // which directions we used for the last one dir1 = dfc.dir1; dir2 = dfc.dir2; dir3 = dfc.dir3; dir4 = dfc.dir4; rot1 = Vector3.down; rot2 = Vector3.up; camCon = (cameraController)Camera.main.gameObject.GetComponent(typeof(cameraController)); camCon.GetTheShapeToChangeItsDirections(this.gameObject); camCon.DependsOnCameraPos(); // custom positions - most of details don't land in the center if (transform.gameObject.name.Contains("Sofa")) { transform.position = new Vector3(ChangeableVariables.LShapeX, transform.position.y + 1.5f, ChangeableVariables.LShapeZ); SpawnGhostShape(); } else if (transform.gameObject.name.Contains("CanShark")) { transform.position = new Vector3(ChangeableVariables.IShapeX, transform.position.y + 2.5f, ChangeableVariables.IShapeZ); SpawnGhostShape(); } else if (transform.gameObject.name.Contains("TV")) { transform.position = new Vector3(ChangeableVariables.OShapeX, transform.position.y + 0.5f, ChangeableVariables.OShapeZ); SpawnGhostShape(); } else if (transform.gameObject.name.Contains("Car")) { transform.position = new Vector3(ChangeableVariables.TShapeX, transform.position.y + 1.5f, ChangeableVariables.TShapeZ); SpawnGhostShape(); } else if (transform.gameObject.name.Contains("Microwave")) { transform.position = new Vector3(ChangeableVariables.ZShapeX, transform.position.y + 1, ChangeableVariables.ZShapeZ); SpawnGhostShape(); } else if (transform.gameObject.name.Contains("Barrels")) { transform.position = new Vector3(ChangeableVariables.SShapeX, transform.position.y + 0.5f, ChangeableVariables.SShapeZ); SpawnGhostShape(); } else if (transform.gameObject.name.Contains("Boxes")) { transform.position = new Vector3(ChangeableVariables.YShapeX, transform.position.y + 0.5f, ChangeableVariables.YShapeZ); SpawnGhostShape(); } else if (transform.gameObject.name.Contains("Fridge")) { transform.position = new Vector3(ChangeableVariables.NShapeX, transform.position.y + 0.5f, ChangeableVariables.NShapeZ); SpawnGhostShape(); } else if (transform.gameObject.name.Contains("BottleBox")) { transform.position = new Vector3(ChangeableVariables.TwoShapeX, transform.position.y + 0.5f, ChangeableVariables.TwoShapeZ); SpawnGhostShape(); } else if (transform.gameObject.name.Contains("WC")) { transform.position = new Vector3(ChangeableVariables.ThreeShapeX, transform.position.y + 0.5f, ChangeableVariables.ThreeShapeZ); SpawnGhostShape(); } else if (transform.gameObject.name.Contains("TNT")) { transform.position = new Vector3(ChangeableVariables.OneShapeX, transform.position.y, ChangeableVariables.OneShapeZ); bgs = GetComponentInChildren <BombGhostShape> (); SpawnGhostShape(); } root = transform.root.gameObject; cr = (ControlRigidbodies)root.GetComponent(typeof(ControlRigidbodies)); }