public void AddCheckPoint(Scr_PlayerCheckpoint newCP) { bool valido = false; for (int i = 0; i < checkPoints.Count; i++) { if (newCP == checkPoints[i]) { return; } if (newCP.order >= checkPoints[i].order) { valido = true; if (newCP.order > checkPoints[i].order) { checkPoints.Remove(checkPoints[i]); } } } if (valido && CheckPointOrder) { checkPoints.Add(newCP); lastCheckPoint = newCP; } else if (!CheckPointOrder) { lastCheckPoint = newCP; } //RespawnControler.instance.ClearRespawnObjects(); //RespawnControler.instance.ClearRepositionEnemies(); }
private void Awake() { thisCP = this; }