public static Condition checkMissionResult(PuzzleManager puzzleManager, PuzzleManager.PuzzleObject catIsHolding, PuzzleManager.PuzzleObject dogIsHolding) { var needsToCheckTrees = false; for (int i = 0; i < PuzzleManager.stageInfo.colCount; i++) { for (int j = 0; j < PuzzleManager.stageInfo.rowCount; j++) { if (puzzleManager.kindMatrix[i, j] == PuzzleManager.PuzzleObject.GOAL_CAT && (puzzleManager.catPosition[0] != i || puzzleManager.catPosition[1] != j)) { return(Condition.CAT_NOT_IN_GOAL_FAIL); } if (puzzleManager.kindMatrix[i, j] == PuzzleManager.PuzzleObject.GOAL_DOG && (puzzleManager.dogPosition[0] != i || puzzleManager.dogPosition[1] != j)) { return(Condition.DOG_NOT_IN_GOAL_FAIL); } if (puzzleManager.kindMatrix[i, j] == PuzzleManager.PuzzleObject.BIRD || puzzleManager.kindMatrix[i, j] == PuzzleManager.PuzzleObject.SQUIRREL || catIsHolding == PuzzleManager.PuzzleObject.BIRD || catIsHolding == PuzzleManager.PuzzleObject.SQUIRREL || dogIsHolding == PuzzleManager.PuzzleObject.BIRD || dogIsHolding == PuzzleManager.PuzzleObject.SQUIRREL) { return(Condition.ANIMAL_NOT_IN_GOAL_FAIL); } if (puzzleManager.kindMatrix[i, j] == PuzzleManager.PuzzleObject.EGG || catIsHolding == PuzzleManager.PuzzleObject.EGG || dogIsHolding == PuzzleManager.PuzzleObject.EGG) { return(Condition.ITEM_NOT_IN_GOAL_FAIL); } if (puzzleManager.kindMatrix[i, j] == PuzzleManager.PuzzleObject.ANIMAL_POINT || puzzleManager.kindMatrix[i, j] == PuzzleManager.PuzzleObject.ANIMAL_POINT_BIRD || puzzleManager.kindMatrix[i, j] == PuzzleManager.PuzzleObject.ANIMAL_POINT_BIRD_X2 || puzzleManager.kindMatrix[i, j] == PuzzleManager.PuzzleObject.ANIMAL_POINT_BIRD_X3 || puzzleManager.kindMatrix[i, j] == PuzzleManager.PuzzleObject.ANIMAL_POINT_SQUIRREL) { needsToCheckTrees = true; } } } if (needsToCheckTrees) { for (int i = 0; i < PuzzleManager.stageInfo.colCount; i++) { for (int j = 0; j < PuzzleManager.stageInfo.rowCount; j++) { if (puzzleManager.kindMatrix[i, j] == PuzzleManager.PuzzleObject.TREE_WITH_BIRD || puzzleManager.kindMatrix[i, j] == PuzzleManager.PuzzleObject.TREE_WITH_BIRD_X2 || puzzleManager.kindMatrix[i, j] == PuzzleManager.PuzzleObject.TREE_WITH_BIRD_X3) { return(Condition.ANIMAL_NOT_IN_GOAL_FAIL); } } } } return(Condition.SUCCESS); }
void Awake() { if (_instance != null && _instance != this) { Debug.Log("Destroying PuzzleManager. "); Destroy(this.gameObject); } else { _instance = this; Debug.Log("PuzzleManager instance created. "); _areaAssets = Resources.LoadAll <Area>("Areas"); Debug.Log(_areaAssets.Length + " Areas loaded. "); _itemAssets = Resources.LoadAll <Item>("DBItems"); Debug.Log("items loaded."); _ruleAssets = Resources.LoadAll <Rule>("Rules"); Debug.Log(_ruleAssets.Length + " rules loaded."); everything.SetActive(true); player.SetActive(true); startingInventory.SetActive(true); //puzzleTree.SetActive(true); generator.SetActive(true); statistics.SetActive(true); } }
void Start() //Don't Touch { this.gameObject.GetComponent <BoxCollider2D>().isTrigger = true; //instance = this; theDM = DialogueManager.instance; theSelect = SelectManager.instance; theOrder = OrderManager.instance; thePlayer = PlayerManager.instance; theDB = DatabaseManager.instance; theCamera = CameraMovement.instance; theMap = MapManager.instance; thePuzzle = PuzzleManager.instance; if (theDB.trigOverList.Contains(11)) { flag = false; } else { flag = true; } if (theDB.trigOverList.Contains(trigNum))//트리거 실행 후 맵에 다시 돌아왔을 때 DB list에 들어가 있으면 다시 실행 안됨. { flag = true; if (repeatBifur != 0) { flag = false; bifur = repeatBifur; } } }
private void ChangeTextWall() { if (wallTextFake) { indexWallText++; if (indexWallText >= wallText.Length) { indexWallText = 0; } // change the text TextMesh textMesh = wallText[indexWallText].GetComponent <TextMesh>(); if (textMesh.text.Length < 1) { string passCode = PuzzleManager.GetPassCodes().ToString(); textMesh.text = textMesh.text + passCode[indexWallText]; } // TODO // start animation (invisible to visible, and back) } else { wallTextFake = true; } }
private void Start() { _pm = GameObject.Find("PuzzleManager").GetComponent <PuzzleManager>(); //int rand = Random.Range(0, _randRotation.Length); //print(rand); //transform.Rotate(0f, 0f, _randRotation[rand]); }
public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.PropertyField(serializedObject.FindProperty("optional")); EditorGUILayout.PropertyField(serializedObject.FindProperty("complete")); EditorGUILayout.PropertyField(serializedObject.FindProperty("maxFalseNodesAllowed")); EditorGUILayout.PropertyField(serializedObject.FindProperty("dragPuzzlePieceHere")); serializedObject.ApplyModifiedProperties(); PuzzleManager myScript = (PuzzleManager)target; if (GUILayout.Button("Creates a New Node (True) from Above Object")) { myScript.AddNodeTrue(myScript.dragPuzzlePieceHere); myScript.dragPuzzlePieceHere = null; } if (GUILayout.Button("Creates a New Node (False) from Above Object")) { myScript.AddNodeFalse(myScript.dragPuzzlePieceHere); myScript.dragPuzzlePieceHere = null; } EditorGUILayout.PropertyField(serializedObject.FindProperty("index"), true); }
void Start() { theDB = FindObjectOfType <DatabaseManager>(); theOrder = FindObjectOfType <OrderManager>(); theMap = FindObjectOfType <MapManager>(); thePlayer = FindObjectOfType <PlayerManager>(); //thePlayer = FindObjectOfType<PlayerManager>(); theSet = FindObjectOfType <SettingManager>(); theAudio = AudioManager.instance; thePaper = PaperManager.instance; thePuzzle = PuzzleManager.instance; //uiList.Add(paper,paperbutton,item,itembutton,map,mapbutton,setting,settingbutton); uiList.Add(paper); uiList.Add(item); uiList.Add(map); uiList.Add(setting); uiButtonList.Add(paperbutton); uiButtonList.Add(itembutton); uiButtonList.Add(mapbutton); uiButtonList.Add(settingbutton); //if(theDB.firstOpen) firstOpen = true; }
private void OnSelectedGameLoopManager(object userData) { _selectedPuzzleManager = userData as PuzzleManager; var scriptableObjectReferenceUpdatedEvent = EditorGUIUtility.CommandEvent("GameLoopManagerReferenceUpdated"); EditorWindow.focusedWindow.SendEvent(scriptableObjectReferenceUpdatedEvent); }
void Start() { anim = GetComponent <Animator>(); anim.Play(ClipName); // 하이어라키의 PuzzleManager를 가져온다. manager = GameObject.Find("PuzzleManager").GetComponent <PuzzleManager>(); }
private void Awake() { puzzleManager = new PuzzleManager(); quadrantManager = new QuadrantManager(); selectedIsm = Isms.GetIsms[new System.Random().Next(0, Isms.GetIsms.Count - 1)]; }
// Use this for initialization void Awake() { interactableItems = GetComponent <InteractableItems> (); roomNavigation = GetComponent <RoomNavigation>(); puzzleManager = GetComponent <PuzzleManager> (); soundEffects = GetComponents <AudioSource>(); }
public virtual void Initialize(PuzzleManager pm) { OnLose += pm.OnLoseGame; OnWin += () => canWin = true; OnWin += pm.OnCheckWin; //each child should call base.Initialize(pm); and then subscribe to relevant events. On those events, either canWin=false;, Lose();, or win();. }
void Start() { instance = this; gameState = States.TUTORIAL; Houses = GameObject.FindGameObjectsWithTag("House"); FadeController.instance.StartFadeIn(5); }
public static void AddPresentToHistory(InventoryTile inventoryElementUsed) { for (int i = currentPointOfTime + 1; i < gridHistory.Count;) { gridHistory.RemoveAt(i); inventoryHistory.RemoveAt(i); } inventoryHistory.Add(inventoryElementUsed); gridHistory.Add(new List <GridChange>(gridPresent)); gridPresent.Clear(); currentPointOfTime = gridHistory.Count - 1; bUndo.interactable = true; bRedo.interactable = false; bClear.interactable = true; if (PuzzleManager.CheckIfCurrentCanBeSubmitted()) { bSubmit.interactable = true; //Debug.Log("PuzzleComplete!"); puzzleCompletePS.Play(); } else { bSubmit.interactable = false; } }
void Start() //Don't Touch { this.gameObject.GetComponent <BoxCollider2D>().isTrigger = true; //instance = this; theDM = DialogueManager.instance; theSelect = SelectManager.instance; theOrder = OrderManager.instance; thePlayer = PlayerManager.instance; theDB = DatabaseManager.instance; theCamera = CameraMovement.instance; theMap = MapManager.instance; thePuzzle = PuzzleManager.instance; if (theDB.trigOverList.Contains(trigNum))//트리거 실행 후 맵에 다시 돌아왔을 때 DB list에 들어가 있으면 다시 실행 안됨. { flag = true; if (repeatBifur != 0) { flag = false; bifur = repeatBifur; } } if (theDB.gameOverList.Contains(23) && trigNum == 52) { activatedHandle.gameObject.SetActive(true); defaultHandle.gameObject.SetActive(false); closed.SetActive(false); opened.SetActive(true); } if (trigNum == 50 && !theDB.trigOverList.Contains(93)) { gameObject.SetActive(false); } }
Vector3 mousePosition; // Vector 3 for the camera void Start () { rb = GetComponent<Rigidbody> (); audioSource = GetComponent<AudioSource> (); puzzleManager = GameObject.FindGameObjectWithTag("PuzzleManager").GetComponent<PuzzleManager> (); //coll = GetComponent<BoxCollider> (); }
// Use this for initialization void Start() { manag = GameObject.Find("PuzzleManager").GetComponent <PuzzleManager> (); ScramblerScore = 0; Rearrange = this.gameObject; isCorrect = false; AddWordToDictionary(); ScrambleText = GameObject.Find("WordPuzzleText").gameObject.GetComponent <Text> (); Answer = GameObject.Find("ScrambleAnswerField").gameObject.GetComponent <InputField> (); ConfirmationText = GameObject.Find("ConfirmationText").gameObject.GetComponent <Text> (); words.TryGetValue(Random.Range(1, words.Count + 1), out CurString); Answer.characterLimit = CurString.Length; Answer.onEndEdit.AddListener(val => { if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter)) { isCorrect = IsWordCorrect(Answer.text); if (isCorrect == false) { PrintMatchPositions(); } if (isCorrect == true) { PrintSuccess(); StartCoroutine(GenerateNewWord()); StartCoroutine(DeActivateRearrange()); } } }); scrambledword = ScrambleWord(CurString); ScrambleText.text = scrambledword; //Debug.Log (scrambledword); }
void Start() { if (transform.parent.parent != null) { pm = transform.parent.parent.GetComponent <PuzzleManager>(); } }
void Start() //Don't Touch { instance = this; theDM = DialogueManager.instance; theSelect = SelectManager.instance; theOrder = OrderManager.instance; thePlayer = PlayerManager.instance; theDB = DatabaseManager.instance; theCamera = CameraMovement.instance; theMap = MapManager.instance; thePuzzle = PuzzleManager.instance; if (theDB.trigOverList.Contains(trigNum))//트리거 실행 후 맵에 다시 돌아왔을 때 DB list에 들어가 있으면 다시 실행 안됨. { flag = true; bird.gameObject.SetActive(false); if (feather != null) { feather.SetActive(false); } } if (thePlayer.currentMapName == "parrothidden" && !theDB.trigOverList.Contains(73) && theDB.gameOverList.Contains(22)) { trig73.SetActive(true); paper73.SetActive(true); } }
// Use this for initialization public void Init() { switch (_whatAmI) { case TypeOfObject.DOOR: break; case TypeOfObject.POTION: break; case TypeOfObject.PUZZLE: _pzManagerOBJ = transform.parent.transform.gameObject; _pzManager = _pzManagerOBJ.GetComponent <PuzzleManager>(); break; case TypeOfObject.Mural: _MuralObj.SetActive(false); _MuralState = false; break; default: break; } transform.parent = null; }
void Start() { theGame = GameManager.instance; theDB = DatabaseManager.instance; thePuzzle = PuzzleManager.instance; thePlayer = PlayerManager.instance; }
void Start() //Don't Touch { instance = this; theDM = DialogueManager.instance; theSelect = SelectManager.instance; theOrder = OrderManager.instance; thePlayer = PlayerManager.instance; theDB = DatabaseManager.instance; theCamera = CameraMovement.instance; theMap = MapManager.instance; thePuzzle = PuzzleManager.instance; if (theDB.trigOverList.Contains(trigNum))//트리거 실행 후 맵에 다시 돌아왔을 때 DB list에 들어가 있으면 다시 실행 안됨. { flag = true; } if (theDB.gameOverList.Contains(2)) //상처치료 { band.SetActive(true); bugs.SetActive(false); animator.SetInteger("state", 1); //thePuzzle.treeFace.GetComponent<Animator>().SetInteger("state", 1); } if (theDB.puzzleOverList.Contains(1)) // { animator.SetInteger("state", 2); //thePuzzle.treeFace.GetComponent<Animator>().SetInteger("state", 2); } }
// Use this for initialization void Start() { // Reference the Game Manager Script gManager = GameObject.Find("Input_Output").GetComponent <GameManager> (); // Reference the Console Script console = GameObject.Find("Input_Output").GetComponent <Console> (); // Reference the Puzzle Manager Script pManager = this.transform.parent.gameObject.GetComponent <PuzzleManager> (); // Get all of the movement tiles of the a specific puzzle map movementRowFloors = GameObject.FindGameObjectsWithTag("FloorMovement"); // Get each row within the puzzle movementRows = GameObject.FindGameObjectsWithTag("RowMovement"); // Reference the starting and ending locaiton of the puzzle startLocation = GameObject.Find("Start"); endLocation = GameObject.Find("End"); // Mark the starting and end points of the map MarkEndPoints(); // Create the player, starting at the start position CreatePlayer(startLocation.transform.position); StartCoroutine("PlayerBreadth"); }
private void Awake() { if (instance == null) { instance = this; } }
private void Awake() { _audioSource = GetComponent <AudioSource>(); _audioSource.clip = _explosionClip; _mainCamera = FindObjectOfType <CameraFollow>(); _puzzleManager = FindObjectOfType <PuzzleManager>(); }
void Start() { Instance = this.GetComponentInParent <PuzzleManager>(); rectTransform = this.GetComponent <RectTransform>(); content = NetworkScene.Register(this); // initial grid position in Puzzle Manager Instance.UpdatePosition(transform.position, rectTransform.gameObject.name); }
private void Awake() { Instance = this; DontDestroyOnLoad(this.gameObject); content = NetworkScene.Register(this); gameController = GameObject.Find("GameController").GetComponent <GameController>(); puzzlespanwer = GameObject.Find("Generator").GetComponent <PuzzleSpanwer>(); }
// Use this for initialization public virtual void Start() { puzzleManagerScript = FindObjectOfType <PuzzleManager>(); slotted = false; active = false; puzzleType = 0; puzzleDifficulty = 0; }
private void Awake() { correctRotation = Mathf.Floor(transform.eulerAngles.z); puzzleManager = transform.parent.GetComponent <PuzzleManager>(); int rand = Random.Range(0, rotations.Length); transform.eulerAngles = new Vector3(0, 0, rotations[rand]); }
void Start() { blockCounterText.text = "Block Counter: " + fallenBlockCounter.ToString(); floorCreation = gameObject.GetComponent <FloorCreation>(); puzzleManager = gameObject.GetComponent <PuzzleManager>(); LoadLevel(); LoadWave(wave); }
private void Awake() { sound = GetComponent <AudioSource>(); puzzleManager = transform.parent.GetComponent <PuzzleManager>(); transform.GetChild(0).gameObject.SetActive(currentState); transform.GetChild(1).gameObject.SetActive(!currentState); }
public override void Initialize(PuzzleManager pm){ base.Initialize(pm); /* Invoke("Lose", timeLimit);//quick and dirty. Mostly dirty - does not respect pausing. //or //*/ //endStamp = Core.gameTime + timeLimit;//respects GameTime pausing //Core.tHeartbeat += checkTimer; }
// Use this for initialization void Start () { _instance = this; _successfullyPlacedKeys = 0; _keys = new List<Transform> { CpuSlot, UsbsSlot, PipeSlot, DisplaySlot, PowerSupplySlot, MotherboardSlot }; }
//private bool canMove; // Use this for initialization void Start() { maxEnemies = 4; meleeEnemyReference = meleeprefab.GetComponent<MeleeEnemy> (); rangedEnemyReference = rangedprefab.GetComponent<RangedEnemy> (); GameObject[] enemyObjs; //gray;// = GameObject.Find ("Grayout").GetComponent<SpriteRenderer>(); player = GameObject.Find("Player").GetComponent<PlayerCharacter>(); puzzle = GameObject.Find ("PuzzleManager").GetComponent<PuzzleManager> (); enemyObjs = GameObject.FindGameObjectsWithTag("enemy"); enemies = new List<Enemy>(); for (int i = 0; i < enemyObjs.Length; i++) { enemies.Add(enemyObjs[i].GetComponent<Enemy>()); } //canMove = true; spawnTimer = 0; coolDownTimer = 5; turn = 1; enemyCount = 0; }
public void Initialize(PuzzleManager pm, int limit){ base.Initialize(pm); pm.validMove += OnMove; canWin = true; //this is a lose condition, so canWin is on by default }
void Start() { GenerationManager.Instance.BorderTexture = Separator; PuzzleManagerInstance = GetComponent<PuzzleManager>(); Assert.Test(PuzzleManagerInstance != null, "Missing PuzzleManager component with ManagersManager"); }
void Start() { manager = GameObject.Find("PuzzleManager").GetComponent<PuzzleManager>(); }
// Use this for initialization void Start () { instance = this; }
public void setHandTile (TileScript tile, int handPosition) { this.tileScript = tile; this.handPosition = handPosition; this.puzzleManager = GameObject.Find ("Puzzle").GetComponent<PuzzleManager> (); TileSprites = Resources.LoadAll<Sprite> (@"Sprites/TileSheet"); HLSprites = Resources.LoadAll<Sprite> (@"Sprites/HighLights"); GetComponent<SpriteRenderer> ().sprite = TileSprites [getTypeIndex (tile.getType ())]; GetComponent<SpriteRenderer> ().sortingOrder = 2; transform.Rotate (0, 0, tile.getRotation () * 60, Space.World); setAlpha (); }
public void setMapTile (TileScript tile) { this.tileScript = tile; this.puzzleManager = GameObject.Find ("Puzzle").GetComponent<PuzzleManager> (); setState (Enums.TilePrefabState.Fixed); TileSprites = Resources.LoadAll<Sprite> (@"Sprites/TileSheet"); HLSprites = Resources.LoadAll<Sprite> (@"Sprites/HighLights"); GetComponent<SpriteRenderer> ().sortingOrder = 1; GetComponent<SpriteRenderer> ().sprite = TileSprites [getTypeIndex (tile.getType ())]; transform.Rotate (0, 0, tile.getRotation () * 60, Space.World); }
void Start() { anim = GetComponent<Animator>(); anim.Play(ClipName); manager = GameObject.Find("PuzzleManager").GetComponent<PuzzleManager>(); }
public virtual void Initialize(PuzzleManager pm){ OnLose += pm.OnLoseGame; OnWin += () => canWin = true; OnWin += pm.OnCheckWin; //each child should call base.Initialize(pm); and then subscribe to relevant events. On those events, either canWin=false;, Lose();, or win();. }
// Use this for initialization void Start() { this.showUI = false; tm = GameObject.Find ("Player").GetComponent<TurnManager> (); pc = GameObject.Find ("Player").GetComponent<PlayerCharacter> (); pm = GameObject.Find("PuzzleManager").GetComponent<PuzzleManager> (); showNumericHealth = PlayerPrefs.GetInt("HealthBarNumbers") == 1; healthtext = new GUIStyle (); healthtext.font = chewy; healthtext.fontSize = 14; healthtext.normal.textColor = Color.white; healthtext.alignment = TextAnchor.UpperCenter; scoreText = new GUIStyle (); scoreText.font = chewy; scoreText.fontSize = Screen.width/15; scoreText.normal.textColor = Color.white; scoreText.alignment = TextAnchor.UpperCenter; comboText = new GUIStyle (); comboText.font = chewy; comboText.fontSize = Screen.width/25; comboText.normal.textColor = Color.white; comboText.alignment = TextAnchor.UpperCenter; tutText = new GUIStyle (); tutText.font = chewy; tutText.fontSize = Screen.width/20; tutText.normal.textColor = Color.white; tutText.alignment = TextAnchor.UpperCenter; buttonStyle = new GUIStyle(); timer = 3.0f; combo2 = false; combo3 = false; combo4 = false; combo5 = false; tut1 = false; tut2 = false; tut3 = false; tut4 = false; }
public override void Initialize(PuzzleManager pm){ base.Initialize(pm); canWin = false; }