public override bool DoInteracted(BlockActor blockActor, Direction direction, GameObject interactor) { //Debug.Log("Interacted"); switch (direction) { case Direction.Down: CharacterActor otherCharacterActor = interactor.GetComponent <CharacterActor>(); if (otherCharacterActor) { Collider2D collision = otherCharacterActor.thisInteractionCollider2D; if (otherCharacterActor.formStateMachine.currentState.isCanBreakBrick) { OperationQueueHelper.RunActionAfterSeconds("BlockBrain_DelayedDisable", 1f, () => { blockActor.gameObject.SetActive(false); }); if (blockActor.content) { Instantiate(blockActor.content, blockActor.thisTransform.position, blockActor.thisTransform.rotation); } Singleton.Get <IAudioController>().PlayOneShot(blockActor.contentAppearSound); //Debug.Log("Destroy"); return(true); } else { blockActor.thisAnimator.PlayNoRepeat("Interacted"); Singleton.Get <IAudioController>().PlayOneShot(blockActor.hitSound); //Debug.Log("Interact"); return(true); } } break; } return(false); }
protected override void Initialize() { ResourceManager.LoadTexture(FrizzyAdventure.Managers.Resource.Model.TextureKey.Dungeon); ResourceManager.LoadTexture(FrizzyAdventure.Managers.Resource.Model.TextureKey.Frizzy); ResourceManager.LoadTexture(FrizzyAdventure.Managers.Resource.Model.TextureKey.GameplayHud); ResourceManager.LoadTexture(FrizzyAdventure.Managers.Resource.Model.TextureKey.Slime); BasicActorConstruction blockConstruction = new BasicActorConstruction() { X = 32, Y = 32, ActorConstructionType = BasicActorConstructionType.DungeonBlock_01 }; var block = new BlockActor(blockConstruction); ActorManager.AddActor(block); blockConstruction.X = 48; block = new BlockActor(blockConstruction); ActorManager.AddActor(block); blockConstruction.Y = 16; block = new BlockActor(blockConstruction); ActorManager.AddActor(block); blockConstruction.X = 80; blockConstruction.Y = 32; block = new BlockActor(blockConstruction); ActorManager.AddActor(block); BasicActorConstruction otherBlockConstruction = new BasicActorConstruction() { X = 32, Y = 48, ActorConstructionType = BasicActorConstructionType.DungeonBlock_03 }; block = new BlockActor(otherBlockConstruction); ActorManager.AddActor(block); otherBlockConstruction.X = 48; block = new BlockActor(otherBlockConstruction); ActorManager.AddActor(block); otherBlockConstruction.X = 64; block = new BlockActor(otherBlockConstruction); ActorManager.AddActor(block); otherBlockConstruction.Y = 32; block = new BlockActor(otherBlockConstruction); ActorManager.AddActor(block); otherBlockConstruction.Y = 16; block = new BlockActor(otherBlockConstruction); ActorManager.AddActor(block); otherBlockConstruction.Y = 0; block = new BlockActor(otherBlockConstruction); ActorManager.AddActor(block); otherBlockConstruction.X = 48; block = new BlockActor(otherBlockConstruction); ActorManager.AddActor(block); otherBlockConstruction.X = 32; block = new BlockActor(otherBlockConstruction); ActorManager.AddActor(block); otherBlockConstruction.X = 16; block = new BlockActor(otherBlockConstruction); ActorManager.AddActor(block); otherBlockConstruction.Y = 16; block = new BlockActor(otherBlockConstruction); ActorManager.AddActor(block); otherBlockConstruction.Y = 32; block = new BlockActor(otherBlockConstruction); ActorManager.AddActor(block); otherBlockConstruction.Y = 48; block = new BlockActor(otherBlockConstruction); ActorManager.AddActor(block); otherBlockConstruction.X = 32; otherBlockConstruction.Y = 16; block = new BlockActor(otherBlockConstruction); ActorManager.AddActor(block); var player = new PlayerActor(ActorManager, ControllerManager); ActorManager.AddActor(player); MapManager.SetCameraFocus(player); MapManager.SetMapSize(200, 160); var slimeConstruction = new BasicActorConstruction { ActorConstructionType = BasicActorConstructionType.SlimeActive, X = 32, Y = 64 }; var slime = new SlimeActor(ActorManager, slimeConstruction); ActorManager.AddActor(slime); }