void Start() { tutorial = GameObject.Find( "Tutorial" ); borders = GameObject.Find( "Borders" ); floors = GameObject.Find( "Floors" ); aimControll = GameObject.Find( "Aim" ).GetComponent<AimControll>(); scoreControll = GameObject.Find( "Score" ).GetComponent<ScoreControll>(); duckControll = GameObject.Find( "Duck" ).GetComponent<DuckControll>(); gameManagerControll = GameObject.Find( "GameManager" ).GetComponent<GameManagerControll>(); }
public void getScoreDetails() { sc = gameController.GetComponent <ScoreControll> (); result = sc.getResultData(); correctGuesses = result.CorrectGuess; wrongGuesses = result.WrongGuess; totalGuesses = correctGuesses + wrongGuesses; timeused_in_String = result.Time_used; score_wrong = result.ScoreDeducted; score_time = result.Bonus_in_time; time = result.Time; finalScore = result.Score; bonus_acc = result.Bonus_in_accuracy; }
protected void Awake() { base.Awake(); _useEditor = false; _defaultAttackSpeed = AttackSpeed; #if UNITY_EDITOR _useEditor = true; #endif CanAttack = false; //combo will stop after 1 sec _stopComboTime = 1.0f; _guiTexts = new List<My3DText>(); foreach (My3DText guiScripts in _gui.GetComponents<My3DText>()) { _guiTexts.Add(guiScripts); if (guiScripts.TextObjectName.Equals("Score")) _scoreText = guiScripts; if (guiScripts.TextObjectName.Equals("Combo")) _comboText = guiScripts; if (guiScripts.TextObjectName.Equals("Life")) _lifeText = guiScripts; if (guiScripts.TextObjectName.Equals("Revive")) _revivePlayerText = guiScripts; } Vector3 targetWidth = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width, Screen.height, 0)); float heroWidth = renderer.bounds.extents.x; float heroHeight = renderer.bounds.extents.y; _maxScreenWidth = targetWidth.x - heroWidth; _maxScreenHeight = targetWidth.y - heroHeight; _revivePlayerText.OnTextClick += ReviveClick; _revivePlayerText.IsVisible = false; _actionButton.OnBtnClick += OnActionButtonClicked; _attackSound = gameObject.AddComponent<AudioSource>(); _attackSound.clip = _attackAudioClip; _attackSound.pitch = 1.1f; _bloodSound = gameObject.AddComponent<AudioSource>(); _bloodSound.clip = _bloodAudioClip; _bloodSound.pitch = 0.7f; _hitSound = gameObject.AddComponent<AudioSource>(); _hitSound.clip = _hitAudioClip; _crySound = gameObject.AddComponent<AudioSource>(); _crySound.clip = _cryAudioClip; _crySound.pitch = 0.5f; _crySound.volume = 0.5f; _reviveSound = gameObject.AddComponent<AudioSource>(); _reviveSound.clip = _reviveAudioClip; _reviveSound.pitch = 1.2f; _reviveSound.volume = 0.9f; _darkScreen = _mainCamera.GetComponentInChildren<Renderer>().material; _shakeAnimator = _mainCamera.GetComponent<Animator>(); _scoreControll = new ScoreControll(); SetVibrateStatus(); }
void Awake() { gameController = GameObject.Find("GameController"); sc = gameController.GetComponent <ScoreControll> (); audioControll = GameObject.Find("AudioController").GetComponent <AudioControll> (); }
void Start() { //スコア制御参照先指定 ScoreScript = FindObjectOfType <ScoreControll>(); }