public void RetryGame() { CheckPointManager.SetNewCheckpoint(m_AreaCheckpoints[0]); RestartAllObjects(); HideMenusAndControls(); }
private void Start() { playAnimations = GetComponent <Animator>(); getInfo = GameObject.FindObjectOfType <CheckPointManager>(); unBroken = GetComponent <SpriteRenderer>().sprite; brokenEffect = GetComponentInChildren <ParticleSystem>(); }
void Awake() { string Scene = SceneManager.GetActiveScene().name; if (instance == null) { instance = this; Object.DontDestroyOnLoad(this.gameObject); } else if (instance != this) { if (Scene != "") { if (instance.assingedLevel == Scene) { Destroy(this.gameObject); } else { CheckPointManager.Points.Clear(); Destroy(instance.gameObject); instance = this; Object.DontDestroyOnLoad(this.gameObject); } } } else { Object.DontDestroyOnLoad(this.gameObject); } }
void Awake() { cpm = GameObject.FindObjectOfType <CheckPointManager>(); platformCheck = GameObject.FindObjectOfType <PlatformCheck>(); child = transform.GetChild(0).gameObject; rotatingParticles = GetComponentInChildren <ParticleSystem>(); }
private void Start() { CheckPointManager cpManager = GetComponent <CheckPointManager>(); Hellfire hellfire = GetComponent <Hellfire>(); sprite = GetComponent <SpriteRenderer>(); }
private void Awake() { if (!CheckPointManager.instance) { instance = this; } }
public override void Die() { //reset data Freezable f = GetComponent <Freezable>(); if (f != null) { f.Unfreeze(); } SpawnPoint[] spawnPoints = GameObject.FindObjectsOfType <SpawnPoint>(); foreach (SpawnPoint point in spawnPoints) { point.ResetSpawn(); } foreach (PotionSelector.PotionElement potionElement in PotionSelector.GetAllPotionElements()) { potionElement.SetCount(0); } Vector3 checkPointPosition = CheckPointManager.GetCheckPointPos(); transform.position = new Vector3(checkPointPosition.x, checkPointPosition.y, transform.position.z); foreach (SpawnPoint point in spawnPoints) { point.SpawnAll(); } currentHealth = maxHealth; HealthSlider.SetValue(1f); }
private void Awake() { if (Instance == null) { Instance = this; } }
void Start() { CheckPointManager.getInstance().onRestart += OnRestart; CheckPointManager.getInstance().onCheckPointChange += OnCheckPointChange; updateState(); existAtLastCheckPoint = CheckPointManager.getInstance().isSceneStart(); }
// Start is called before the first frame update void Start() { //coletando componentes anim = this.gameObject.GetComponent <Animator> (); rigb = this.gameObject.GetComponent <Rigidbody2D> (); trs = this.gameObject.GetComponent <Transform> (); spr = this.gameObject.GetComponent <SpriteRenderer> (); camcontroll = GameObject.FindWithTag("MainCamera").gameObject.GetComponent <CameraBehavior>(); lifeBar = HealthBar.Instance.GetComponent <HealthBar>(); movSen = 1; lstmovSen = 1; life = maxlife; Vector2 chckpos = CheckPointManager.GetLastCheckPoint(); if (chckpos != Vector2.zero) { GameEvents.ScreamEvent("CheckPointFound"); trs.position = chckpos; playable = true; } playable = true; InPut = InputManager.instance; }
void OnTriggerEnter(Collider col) { if (col.CompareTag(collisionTag) && idMem != CheckPointManager.getIdMem()) { CheckPointManager.SetMementoId(idMem); Destroy(gameObject); } }
//Allow Checkpoint Manager to set its reference on each level load public void SetCheckpointManager(string checkpointManagerName) { checkpointManager = GameObject.FindGameObjectWithTag(checkpointManagerName); if (checkpointManager != null) { checkpoints = checkpointManager.GetComponent <CheckPointManager>(); } }
// Start is called before the first frame update void Start() { instance = this; CheckPointBehaviour.ReachCheckPoint = UpdateLastCheckPoint; firstCheckPoint = new GameObject("FirstPos"); firstCheckPoint.transform.position = garomo.transform.position; lastCheckPoint = firstCheckPoint; }
void Start() { EventManager.instance.SubscribeEvent("EnableGlide", EnableGlide); CheckPointManager checkpointManager = UnityEngine.Object.FindObjectOfType <CheckPointManager>(); checkpointManager.CreateEvents(); EventManager.instance.SubscribeEvent("Roll", SetRolling); // GameManager.instance.LoadCheckPoint(); }
private void Awake() { cpManager = GameObject.FindGameObjectWithTag("Player").GetComponent <CheckPointManager>(); seeling = GameObject.FindGameObjectWithTag("SeelingEnemy").GetComponent <SeelingEnemy>(); fireDude = GameObject.FindGameObjectWithTag("FireDude").GetComponent <FireDudeEnemy>(); sprite = GetComponent <SpriteRenderer>(); rb = GetComponent <Rigidbody2D>(); bloodSplash = GetComponentInChildren <ParticleSystem>(); }
private void Start() { checkPointManager = CheckPointManager.instance; transform.position = checkPointManager.GetLastCheckPoint().transform.position; hasGun = checkPointManager.hadGun; SetMovementRelation(); GetMovmentDir(GameManager.Instance.mainCamera.transform); }
void Start() { anim = this.gameObject.GetComponent <Animator>(); isOn = CheckPointManager.GetCheckPoint(checknum); if (isOn) { anim.Play("on"); } }
public override void OnInspectorGUI() { EditorGUIUtility.LookLikeInspector(); CheckPointManager CPManager = target as CheckPointManager; CPManager.name = CPManager.name; CoreFunctions.CreateCheckPointManagerInspector(CPManager); }
private void OnTriggerEnter(Collider l_Collision) { if (l_Collision.gameObject == GameController.Instance.GetPlayerGameObject()) { if (CheckPointManager.SetNewCheckpoint(this)) { DisableThisCheckpoint(); } } }
void Awake() { cpm = FindObjectOfType(typeof(CheckPointManager)) as CheckPointManager; rend = GetComponent <SpriteRenderer>(); cpm.AllCheckpoints.Add(this as CheckPoint); if (StartingCheckPoint) { cpm.SetReached(this); } }
void Awake() { _instance = this; player = GameObject.FindGameObjectWithTag(PlayerTag); gameDialogueObject = FindObjectOfType(typeof(GameDialogue)) as GameDialogue; scenarioControlObject = FindObjectOfType(typeof(ScenarioControl)) as ScenarioControl; backGroundMusicPlayer = FindObjectOfType(typeof(BackgroundMusicPlayer)) as BackgroundMusicPlayer; checkPointManager = FindObjectOfType(typeof(CheckPointManager)) as CheckPointManager; playerRuntimeCameraConfig = FindObjectOfType(typeof(PlayerCameraRuntimeConfig)) as PlayerCameraRuntimeConfig; }
public override void OnInspectorGUI() { base.OnInspectorGUI(); CheckPointManager selected = (CheckPointManager)target; if (GUILayout.Button("InitChecpoints")) { selected.Initialisation(); } }
private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } }
public override void Interact() { CheckPointManager.SetCheckPoint(this); if (!active) { active = true; renderer.sprite = activatedCheckpoint; screenLight.enabled = true; interactionSprite.enabled = false; } }
void Awake() { if (cm == null) { cm = this; DontDestroyOnLoad(cm); } else { Destroy(gameObject); } }
void Start() { rb = GetComponent <Rigidbody>(); cpManager = GameObject.Find("Check Point Manager").GetComponent <CheckPointManager>(); maxSpeed = 10000f; speed = maxSpeed; turnSpeed = 1.5f; hoverForce = 50f; hoverHeight = 2f; }
void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(instance); } else { Destroy(gameObject); } }
void OnTriggerEnter2D(Collider2D other) { if (!isOn) { if (other.gameObject.tag == "Player") { CheckPointManager.RefreshCheckPoint(checknum, this.gameObject.GetComponent <Transform>().position); isOn = true; anim.Play("on"); } } }
public void resetScene() { princesse.GetComponent <Animator>().SetBool("IsDead", false); princesse.GetComponent <PrincesseDeplacement>().UnlockPrincesse(); princesse.GetComponent <PrincesseVie>().PlayOneTimeDie = false; for (int i = 1; i < listTransform.Length; i++) { listTransform[i].gameObject.SetActive(false); } CheckPointManager.getInstance().restartCheckPoint(); Cursor.visible = false; }
// Activation du checkPoint public void trigger() { Debug.Log("CheckPoint \" " + gameObject.name + "\" atteint"); this.triggered = true; CheckPointManager.getInstance().OnCheckPointTriggered(); if (onTrigger != null) { onTrigger(); // on notifit de l'activation d'un nouveau checkPoint } }