// Start is called before the first frame update void Start() { inventoryAnvilRenderer.SetActive(false); mouseLook = playerMainCamera.GetComponent <MouseLook>(); foundAnvil = blacksmithing.GetComponent <OpenChest>(); testCrafting.inventoryMenu.localScale = new Vector3(0, 0, 0); craftingHolder.localScale = new Vector3(0, 0, 0); }
private void Start() { colliders = GetComponentsInChildren <Collider>(); rb = GetComponentInParent <Rigidbody>(); chest = GetComponentInParent <OpenChest>(); audioSource = GetComponent <AudioSource>(); anim = GetComponent <Animator>(); }
// Update is called once per frame void Update() { for (int i = 0; i < deadRooms.Length; i++) { if (deadRooms[i].Equals(SceneManager.GetActiveScene().name)) { GameObject[] g = GameObject.FindGameObjectsWithTag("Enemy"); for (int j = 0; j < g.Length; j++) { //g[i].GetComponent<EnemyHealthManager>().HurtEnemy(100000); Destroy(g[j]); } } } GameObject test = GameObject.Find("Dungeon1 Entry"); if (test != null) { dungeonLock = GameObject.Find("Dungeon1 Entry").GetComponent <LoadNewArea> (); dungeonLock.locked = dungeonLockBool; } test = GameObject.Find("ThirdRoom Entry"); if (test != null) { thirdRoomLock = GameObject.Find("ThirdRoom Entry").GetComponent <LoadNewArea> (); thirdRoomLock.locked = thirdRoomLockBool; } test = GameObject.Find("ArmorRoom Entry"); if (test != null) { armorRoomLock = GameObject.Find("ArmorRoom Entry").GetComponent <LoadNewArea> (); armorRoomLock.locked = armorRoomLockBool; } test = GameObject.Find("SpawnChest"); if (test != null) { spawnChest = GameObject.Find("SpawnChest").GetComponent <OpenChest> (); spawnChest.hasHealthPotion = !spawnChestOpened; } test = GameObject.Find("ThirdRoomChest"); if (test != null) { thirdRoomChest = GameObject.Find("ThirdRoomChest").GetComponent <OpenChest> (); thirdRoomChest.hasHealthPotion = !thirdRoomChestOpened; } }
public bool Hit(GameObject gameObject) { var treasureChest = gameObject.GetComponent <TreasureChest>(); if (!treasureChest.Opened) { var openChest = new OpenChest(treasureChest); MessageQueue.Instance.Post(openChest); } return(false); // Player cannot pass }
private void MovePlayer(Vector2 direction) { var hit = Physics2D.Raycast(transform.position, direction, 1f); if (hit && hit.collider.tag == WorldObjectTag.Impassable) { return; } if (hit && hit.collider.tag == WorldObjectTag.TreasureChest) { var openChest = new OpenChest(hit.collider.GetComponent <TreasureChest>()); MessageQueue.Instance.Post(openChest); return; } MessageQueue.Instance.Post(new MovePlayer(direction)); }
public void Rehearsal() { var action = new OpenChest(); var address = default(Address); var nextState = action.Execute(new ActionContext() { PreviousStates = new State(ImmutableDictionary <Address, IValue> .Empty), Signer = address, Rehearsal = true, BlockIndex = 1, }); Assert.Equal( ImmutableHashSet.Create( address, GoldCurrencyState.Address ), nextState.UpdatedAddresses ); }
// Use this for initialization void Start() { _player = GameObject.FindGameObjectWithTag("Player"); OpenedChest = GetComponent<OpenChest>(); }
private void ChestOpened(OpenChest chest) { _chests++; }
void Awake() { my = this; isFirst = true; }
// Start is called before the first frame update private void Awake() { instance = this; }
private void Start() { openChest = GetComponentInChildren <OpenChest>(); openChest.speed = 3f; }