//The game has states Downtime, Cutscene, Gametime //Gametime can link to different game modes longJump, highJump, race void Start() { currentGameMode = gameMode.longjump; currentState = gameState.downtime; jumpManager = FindObjectOfType <JumpManager>(); UpdateGameStateText(); }
/* Called on build */ private void Start() { TAG += name + " "; //load the events int i = 0; foreach (Transform child in transform) { EventIM e = child.GetComponentInChildren <EventIM>(); if (e.nextEvent != null && e.nextEvent.name == "Response") //response doesn't have next until completed { e.nextEvent.GetComponent <Response>().setDialog(e.gameObject); } events.Add(e); i++; } //todo fix the dialog for the response jm = gameObject.GetComponent <JumpManager>(); jm.load(events); currEvent = jm.getFirstEvent(); nextEvent = jm.getNextEvent(currEvent); setWants(); }
private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Player")) { JumpManager.resetJump(jumpFalse); } }
public void Init(PlayerController _playerController) { // Si erreur dans les données du prefab, on recrée : if (stats == null || stats.Length < (int)StatType.MAX_STATS) { stats = new Stat[(int)StatType.MAX_STATS]; stats[(int)Stats.StatType.GROUND_SPEED].baseStat = 28; stats[(int)Stats.StatType.AIR_CONTROL].baseStat = 20; } // ON récupère la hauter du saut : JumpManager jp = _playerController.GetComponent <JumpManager>(); if (jp != null) { stats[(int)Stats.StatType.JUMP_HEIGHT].baseStat = jp.GetJumpHeight(); } // On actualise les nom et les current stats : for (int i = 0; i < (int)StatType.MAX_STATS; i++) { stats[i].name = ((StatType)i).ToString(); stats[i].currentStat = stats[i].baseStat; } playerController = _playerController; buffList = new List <StatBuff>(); }
//Awake void Awake() { player = GetComponent <Player>(); mgMovement = GetComponent <MovementManager>(); mgJump = GetComponent <JumpManager>(); cdbCombo = (cdbAttack + cdbRecovery) * 3; }
private void OnEnable() { pm = (target as JumpManager); parabolaPropTab = new SerializedProperty[3]; parabolaPropTab[0] = serializedObject.FindProperty("jumpToTest.upParabola"); parabolaPropTab[1] = serializedObject.FindProperty("jumpToTest.fallingParabola"); parabolaPropTab[2] = serializedObject.FindProperty("jumpToTest.minJumpParabola"); }
//Awake void Awake() { boss = GetComponent <Boss>(); mgJump = boss.mgJump; mgMovement = boss.mgMovement; mgPrefab = boss.mgPrefab; mgSize = boss.mgSize; mgLevel = boss.mgLevel; }
public override void OnBegin() { base.OnBegin(); playerController.Rb.velocity = Vector3.zero; JumpManager jumpManager = playerController.GetComponent <JumpManager>(); if (jumpManager != null) { jumpManager.Stop(); } timer = 0; maxDashChargeDelay = .7f; downDashPower = 100f; curUpdateFct = Levitate; }
private void UpdateStat(StatType stat) { float newStatValue = stats[(int)stat].baseStat; for (int i = 0; i < buffList.Count; i++) { if (buffList[i].StatType == stat) { newStatValue *= buffList[i].Value; } } stats[(int)stat].currentStat = newStatValue; JumpManager jp = playerController.GetComponent <JumpManager>(); switch (stat) { case StatType.GROUND_SPEED: if (jp != null) { if (jp.jumpTab != null) { jp.jumpTab[(int)JumpManager.JumpEnum.Basic].InitValues(stats[(int)stat].currentStat); } } break; case StatType.JUMP_HEIGHT: if (jp != null) { if (jp.jumpTab != null) { jp.SetJumpHeight(stats[(int)StatType.JUMP_HEIGHT].currentStat, stats[(int)StatType.GROUND_SPEED].currentStat); } } break; default: break; } }
bool CheckPoints(int posX, int posY) { Vector3 originPos = new Vector3(posX, 0.1f, -posY + 4); bool jump = false; if (board[posX, posY] == 3) { jump = true; // Spawn 4 points token Destroy(tokenRegistry[posX, posY]); TokenRegister(Instantiate(Token4, originPos, Quaternion.identity)); } else { if (tokenRegistry[posX, posY] != null) { Destroy(tokenRegistry[posX, posY]); } board[posX, posY] += 1; // Spawn new token switch (board[posX, posY]) { case 1: TokenRegister(Instantiate(Token1, originPos, Quaternion.identity)); break; case 2: TokenRegister(Instantiate(Token2, originPos, Quaternion.identity)); break; case 3: TokenRegister(Instantiate(Token3, originPos, Quaternion.identity)); break; } } return(jump); }
private void Awake() { JM = this; }