void OnTriggerEnter2D(Collider2D other) { if (string.Compare(other.tag, "Player") == 0) { LadderManager.SetLadderBounds(GetComponent <BoxCollider2D>().bounds); } }
void OnTriggerExit2D(Collider2D other) { if (string.Compare(other.tag, "Player") == 0) { LadderManager.ResetStatus(); } }
void OnSceneLoaded(Scene scene, LoadSceneMode mode) { // scene 0 ~ 2 level number is -1 0 1, later unchange // scene 2~4 sublevel 1 2 3 if (scene.buildIndex >= 2) { level = 1; subLevel = scene.buildIndex - 1; // assign player position GameObject p = GameObject.FindGameObjectWithTag("Player"); player = p.transform; playerScript = p.GetComponent <UnityStandardAssets._2D.PlatformerCharacter2D>(); userCtrl = p.GetComponent <UnityStandardAssets._2D.Platformer2DUserControl>(); findNotificationManager(); ladderManager = GameObject.Find("TrapDoorTriggers").GetComponent <LadderManager>(); if (startFromLoad) { SetupFromLoad(); startFromLoad = false; } InitGame(); } else { level = -1; } }
void Awake() { isMove = false; isLadder = false; layerMask = 1 << playerRigidbody.gameObject.layer | 1 << 2; layerMask = ~layerMask; _internal = this; }
void Awake() { if (Instance != null) { Destroy(gameObject); return; } Instance = this; //Spawn ladder at random location ladder = Instantiate<GameObject>(ladderPrefab); ladder.transform.position = spawnLocations[Random.Range(0, spawnLocations.Length)].position; Physics.IgnoreCollision(ladder.GetComponent<Collider>(), GetComponent<Collider>()); }
public void CreateLadder_MinHigherThanMax() { //Arrange LadderManager ladderManager = new LadderManager("test"); LadderDTO ladderDTO = new LadderDTO() { ID = "", Game = Games.CallOfDuty, MaximumElo = 1500, MinimumElo = 2000, Name = "Bronze Call of Duty Ladder" }; //Act var result = ladderManager.CreateLadder(ladderDTO); //Assert Assert.AreEqual(LadderErrorCodes.MinHigherThanMax, result); }
void OnDestroy() { Instance = null; }