/** * Detects if player has been placed, and the health canvis has been sucessfully activated. */ private void UIMediation() { PlayerHealthUI_Refactor healthInfo = GameObject.Find("HealthCanvas").GetComponentInChildren <PlayerHealthUI_Refactor>(); GameObject player = GameObject.Find("Alpaca"); if ((healthInfo != null) && (player != null)) { bool healthStartHasRun = healthInfo.startHasRun; if (healthStartHasRun) { uiMediationAccomplished = true; } } }
private GameOverController gameOverMenu; // Game over controller script void Start() { model = GetComponent <PlayerModel>(); view = GetComponent <PlayerView>(); playerHealthScript = GameObject.Find("Heart Storage").GetComponent <PlayerHealthUI_Refactor>(); meleeWeaponScript = GetComponent <MeleeWeapon>(); meleeWeaponScript.AttackDamage = model.meleeAttackDamage; meleeWeaponScript.attackRange = model.meleeAttackRange; rangedWeaponScript = GetComponent <RangedWeapon>(); rangedWeaponScript.damage = model.rangedAttackDamage; rangedWeaponScript.speed = model.rangedAttackProjectileSpeed; gameOverMenu = GameObject.Find("GameOverCanvas").GetComponent <GameOverController>(); }