private void Awake() { if (!_instance) { _instance = this; } else { Destroy(gameObject); } }
void Awake() { if (singleton == null) { singleton = this; fillObject = healthSlider.fillRect.gameObject; } else { Destroy(gameObject); } }
public override void OnStart() { i = this; base.SetScreenAction(thisScreen: ScreenState.Game); this.ObserveEveryValueChanged(currentStageIndex => Variables.currentSceneBuildIndex) .Subscribe(currentStageIndex => { ShowStageNumText(); }) .AddTo(this.gameObject); gameObject.SetActive(true); tutrialHandController.OnStart(); retryButton.onClick.AddListener(OnClickRetryButton); }
public override void OnStart() { i = i ?? this; base.SetScreenAction(thisScreen: ScreenState.Game); this.ObserveEveryValueChanged(currentStageIndex => Variables.currentStageIndex) .Subscribe(currentStageIndex => { ShowStageNumText(); }) .AddTo(this.gameObject); this.ObserveEveryValueChanged(humanCount => Variables.humanCount) .Subscribe(humanCount => humanCountText.text = humanCount.ToString()) .AddTo(this.gameObject); gameObject.SetActive(true); }
public override void OnStart() { i = this; base.SetScreenAction(thisScreen: ScreenState.Game); this.ObserveEveryValueChanged(currentSceneBuildIndex => Variables.currentSceneBuildIndex) .Subscribe(currentSceneBuildIndex => { ShowStageNumText(); }) .AddTo(this.gameObject); this.ObserveEveryValueChanged(tapCountLeft => GameManager.i?.tapCountLeft) .Subscribe(tapCountLeft => { tapCountText.text = "x " + tapCountLeft; }) .AddTo(this.gameObject); gameObject.SetActive(true); retryButton.onClick.AddListener(base.ReLoadScene); tutrialHandController.OnStart(); }
public override void OnStart() { if (i == null) { i = this; } base.SetScreenAction(thisScreen: ScreenState.Game); this.ObserveEveryValueChanged(point => Variables.status.point) .Subscribe(point => { pointText.text = "★ " + point; }) .AddTo(this.gameObject); this.ObserveEveryValueChanged(level => Variables.status.growthIndex + 1) .Subscribe(level => { levelUpTextAnim(level); levelText.text = "Player\nLv." + level; }) .AddTo(this.gameObject); gameObject.SetActive(true); }
// Start is called before the first frame update void Start() { idle = true; wantsToHug = false; hugging = false; enoughHugging = false; walkingTowardsPoint = false; idleBody.SetActive(true); huggingBody.SetActive(false); WalkingEffectEmissionActive(false); LovingEffectEmissionActive(false); anim = GetComponent <Animator>(); // lastTimeHuggingDecission = Time.time; player = GameObject.Find("Player").GetComponent <Player> (); speed = speed + Random.Range(0, speedNoise); gameCanvasManager = FindObjectOfType <GameCanvasManager>(); SetRandomHat(); }
private void Awake() { instance = this; if (players == null) { players = new List <Player>(); } gameSceneManager = this.GetComponent <GameSceneManager>(); gameCanvasManager = this.GetComponent <GameCanvasManager>(); if (playerTag == "") { Debug.LogError("You need to define a tag for the player"); } if (disablingObjectTag == "") { Debug.LogError("You need to define a tag for the disabling objects"); } if (checkpointTag == "") { Debug.LogError("You need to define a tag for the checkpoints"); } }
void Start() { canvasManager = GameObject.Find("GameCanvas").GetComponent <GameCanvasManager>(); highScoreManager = GameObject.Find("GameController").GetComponent <HighScoreManager>(); sceneLoaderManager = GameObject.Find("SceneLoader").GetComponent <SceneLoaderManager>(); }