private EnemyCreator enemy_creator = null; // 방해 캐릭터 크리에이터. // ================================================================ // // MonoBehaviour에서 상속. void Start() { this.player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerControl>(); // this.last_block.is_created = false; this.level_control = new LevelControl(); this.level_control.initialize(); this.level_control.loadLevelData(this.level_data_text); this.player.level_control = this.level_control; // this.game_root = this.gameObject.GetComponent <GameRoot>(); this.block_creator = this.gameObject.GetComponent <BlockCreator>(); this.coin_creator = this.gameObject.GetComponent <CoinCreator>(); this.enemy_creator = this.gameObject.GetComponent <EnemyCreator>(); this.block_creator.map_creator = this; this.coin_creator.map_creator = this; this.enemy_creator.map_creator = this; // this.create_floor_block(); }
public static BlockCreator GetSingleton() { if (singleton == null) { singleton = new GameObject("_BlockCreator").AddComponent <BlockCreator> (); } return(singleton); }
public static BlockCreator GetSingleton() { if (instance == null) { instance = new GameObject("_BlockCreator").AddComponent <BlockCreator>(); } return(instance); }
// Use this for initialization void Start() { this.player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerControl>(); this.last_block.is_created = false; this.block_creator = this.gameObject.GetComponent <BlockCreator>(); this.level_control = new LevelControl(); this.level_control.initialize(); }
IEnumerator CreateHingeJoint() { yield return(new WaitForSeconds(0.2f)); hJoint = gameObject.AddComponent <HingeJoint> (); Vector3 blockTransform = BlockCreator.GetSingleton().GetRelativeBlock(transform.position.z); FindRelativePosForHingeJoint(blockTransform); }
private void Check() { UpdateActiveByActualDate(); var blockWithoutContentCount = BlockCreator.GetBlocksWithoutContent().Count; var outdatedRelationCount = SiteObjectService.GetRelationWithNotActive().Count; if (blockWithoutContentCount > 0 || outdatedRelationCount > 0) { SendMail(CreateBody(blockWithoutContentCount, outdatedRelationCount)); } }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
private List <BlockModel> _GetInitialBlocks() { var blocks = new List <BlockModel>(); var smallBlock = BlockCreator.GetRandomBlock(GameTypes.BlockSizeType.Small); var mediumBlock = BlockCreator.GetRandomBlock(GameTypes.BlockSizeType.Medium); var largeBlock = BlockCreator.GetRandomBlock(GameTypes.BlockSizeType.Large); blocks.Add(smallBlock); blocks.Add(mediumBlock); blocks.Add(largeBlock); return(blocks); }
void Start() { player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerControl>(); last_block.is_created = false; block_creator = GetComponent <BlockCreator>(); item_creator = GetComponent <ItemCreator>(); monster_creator = GetComponent <MonsterCreator>(); game_root = GetComponent <GameRoot>(); level_control = new LevelControl(); level_control.initialize(); level_control.loadLevelData(this.level_data_text); }
void Start() { this.player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerControl>(); this.last_block.is_created = false; this.block_creator = this.gameObject.GetComponent <BlockCreator>(); this.level_control = new LevelControl(); this.level_control.initialize(); this.level_control.loadLevelData(this.level_data_text); this.game_root = this.gameObject.GetComponent <GameRoot>(); this.game_root.level_control = this.level_control; this.player.level_control = this.level_control; this.player.game_root = this.game_root; }
private void LateUpdate() { if (player != null) { transform.position = new Vector3(xPos, player.position.y - yDifference, player.position.z - zDifference); int passageIndex = Mathf.CeilToInt(player.position.z); if (passageIndex > lastPassageIndex + passageConstant) { lastPassageIndex = passageIndex; BlockCreator.GetSingleton().UpdateBlockPosition(lastPassageIndex); } } }
public void CanWordBeSpelled_GivenBear_ShouldReturnTrue() { //arrange (test data) string incomingWord = "BEAR"; var firstBlockCreator = new BlockCreator(); var firstPile = firstBlockCreator.CreateBlocks(); var testInstance = new PuzzleSolver(); //action (do some work) bool isItSpellable = testInstance.CanWordBeSpelled(incomingWord, firstPile); //assert - check that the result of your action is that what you expected Assert.True(isItSpellable); }
void OnGUI() { // GUI.Label(new Rect(left,20,500,800), "HOW TO PLAY HOBO SOLITAIRE \n \nClick any block to begin. \nClick another block. \nYour move is scored and the previous block goes away. \nContinue until there's only one block left. \n\nScore points by: \n\nWORD: matching words \nSYMBOL: matching symbols \nSEQUENCE: going up by one number (9 wraps to 0) \nPROXIMITY: the blocks are touching \n\nWhen you score points in a category, the multiplier for that \ncategory increases."); // // GUI.Label(new Rect(left,290,1000,20), "------------------------------------------------------------"); GUI.Label(new Rect(left, 325, 1000, 20), "SPACEBAR = Reset Current Board"); GUI.Label(new Rect(left, 345, 1000, 20), "N = Create New Board"); // GUI.Label(new Rect(right,20,1000,20), "CURRENT MULTIPLIERS"); // GUI.Label(new Rect(right,40,1000,20), "Symbol / Word = x" + ScoreKeeper.symWrdVal); // GUI.Label(new Rect(right,58,1000,20), "Sequence = x" + ScoreKeeper.seqVal); // GUI.Label(new Rect(right,76,1000,20), "Proximity = x" + ScoreKeeper.prxVal); // // GUI.Label(new Rect(right,105,1000,20), "------------------------------------------------------------"); // // GUI.Label(new Rect(right,140,1000,20), "LAST MOVE"); // GUI.Label(new Rect(right,160,1000,20), "Symbol = " + ScoreKeeper.symPts); // GUI.Label(new Rect(right,178,1000,20), "Word = " + ScoreKeeper.wrdPts); // GUI.Label(new Rect(right,196,1000,20), "Sequence = " + ScoreKeeper.seqPts); // GUI.Label(new Rect(right,214,1000,20), "Proximity = " + ScoreKeeper.prxPts); // // GUI.Label(new Rect(right,242,1000,20), "Total = " + ScoreKeeper.newPts); // // GUI.Label(new Rect(right,275,1000,20), "------------------------------------------------------------"); // // GUI.Label(new Rect(right,310,1000,20), "SCORE = " + ScoreKeeper.score); // GUI.Label(new Rect(right,330,1000,20), "Best Score for this Board = " + ScoreKeeper.bestScore); //BOARD CODE STUFF GUI.Label(new Rect(left, 375, 1000, 20), "The code for this board = " + BlockCreator.currentSeed); boardCode = GUI.TextField(new Rect(left, 395, 55, 20), boardCode, 6); if (GUI.Button(new Rect(75, 395, 90, 20), "Enter Code")) { BlockCreator.ClearBoard(); BlockCreator.FixedRandomizer(); BlockCreator.PullBlocks(); BlockCreator.MakeBoard(); } GUI.Label(new Rect(left, 425, 1000, 200), BlockCreator.quote); }
public void Start() { harmony = new Harmony("me.fistme.raft.autorecipe"); harmony.PatchAll(Assembly.GetExecutingAssembly()); // We use FindObjectsOfType() here in the case of mod unloading->loading, as Unity might not actually detach our scripts even if Destroy()ed foreach (var autoRecipe in FindObjectsOfType <AutoRecipeBehaviour>()) { autoRecipe.Kill(); } foreach (var comp in FindObjectsOfType <CookingPot_Recipe_UI>()) { if (BlockCreator.GetPlacedBlocks().Contains(comp.GetComponent <Block>())) { comp.gameObject.AddComponent <AutoRecipeBehaviour>(); } } }
/// <summary> /// Sets a code block in this context. If the block exists, it is set in /// the context in which it was declared. Otherwise, it is declared in this context. /// </summary> /// <param name="name">the constant name</param> /// <param name="block">a method that can be called to initialize the block</param> public void SetBlock(string name, BlockCreator block) { ObjectContext c = FindBlockContext(name); if (c == null) { _blocks.Add(name, block); #if SHOW_OBJECTS Console.WriteLine("{1} declared in {0}", GetHashCode(), name); #endif } else { c._blocks[name] = block; #if SHOW_OBJECTS Console.WriteLine("{1} set in {0}", c.GetHashCode(), name); #endif } }
void PointerDown() { if (!GameManager.Instance.IsGameOn) { ActionSystem.OnGameStarted?.Invoke(); } isTouchingTheScreen = true; if (hJoint == null) { hJoint = gameObject.AddComponent <HingeJoint>(); var target = BlockCreator.GetSingleton().GetRelativeBlock(transform.position); if (target != null) { FindRelativePosForHingeJoint(target.position, target.lossyScale.y); } else { print("NoTarget"); } } }
private CookingPot FindClosestCookingPot() { float sqrMag = float.MaxValue; CookingPot cookingPot = null; foreach (var block in BlockCreator.GetPlacedBlocks()) { var candidate = block.GetComponent <CookingPot>(); if (candidate == null || !Traverse.Create(candidate).Field <bool>("hasBeenPlaced").Value) { continue; } var sqrMagToCandidate = (candidate.transform.position - transform.position).sqrMagnitude; if (sqrMagToCandidate <= Player.UseDistance * Player.UseDistance && sqrMagToCandidate < sqrMag) { sqrMag = sqrMagToCandidate; cookingPot = candidate; } } return(cookingPot); }
private static void BlockCreator_CreateBlock(BlockCreator __instance, Block __result) => Get.OnBlockCreated(__result);
// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag ("Player").GetComponent<PlayerControl> (); last_block.is_created = false; blockCreator = gameObject.GetComponent<BlockCreator> (); }
// ================================================================ // // MonoBehaviour からの継承. void Start() { this.player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerControl>(); // this.last_block.is_created = false; this.level_control = new LevelControl(); this.level_control.initialize(); this.level_control.loadLevelData(this.level_data_text); this.player.level_control = this.level_control; // this.game_root = this.gameObject.GetComponent<GameRoot>(); this.block_creator = this.gameObject.GetComponent<BlockCreator>(); this.coin_creator = this.gameObject.GetComponent<CoinCreator>(); this.enemy_creator = this.gameObject.GetComponent<EnemyCreator>(); this.block_creator.map_creator = this; this.coin_creator.map_creator = this; this.enemy_creator.map_creator = this; // this.create_floor_block(); }
void Start() { this.player = GameObject.FindGameObjectWithTag( "Player").GetComponent<PlayerControl>(); this.last_block.is_created = false; this.block_creator = this.gameObject.GetComponent<BlockCreator>(); this.level_control = new LevelControl(); this.level_control.initialize(); }
void Start() { BlockCreator.GetSingleton().Initialize(30, blockPrefabs, pointPrefab); FindRelativePosForHingeJoint(new Vector3(0, 5, 0)); }
// Use this for initialization void Start() { blockC = GetComponent<BlockCreator> (); }
// Use this for initialization void Start() { this.player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerControl>(); this.last_block.is_created = false; this.block_creator = this.gameObject.GetComponent<BlockCreator>(); this.level_control = new LevelControl(); this.level_control.initialize(); //テキストからデータを読み出す this.level_control.loadLevelData(this.level_data_text); this.game_root = this.gameObject.GetComponent<GameRoot>(); this.player.level_control = this.level_control; }
// Use this for initialization void Start() { blockC = GetComponent <BlockCreator> (); }