コード例 #1
0
 private void Start()
 {
     _ladderThemeScript = transform.parent.GetComponent <LadderTheme>();
     _audio             = GetComponent <AudioSource>();
     _audio.playOnAwake = false;
     _audio.volume      = int.Parse(name[name.Length - 1].ToString()) == 1 ? 1 : 0;
     _fadeState         = FadeState.None;
 }
コード例 #2
0
    void Start()
    {
        _rigidbody = transform.GetComponent <Rigidbody>();

        _wallScript        = GameObject.Find("Main Wall").GetComponent <Wall>();
        _platformScript    = GameObject.Find("Player").GetComponent <Platform>();
        _ladderThemeScript = GameObject.Find("Ladder Theme").GetComponent <LadderTheme>();
        _scoreboardScript  = GameObject.Find("Scoreboard").GetComponent <Scoreboard>();
        _gameCameraScript  = GameObject.Find("Main Camera").GetComponent <GameCamera>();

        _startPosition = GameObject.Find("StartHole").transform.position;

        _isGoal     = false;
        Teleporting = false;

        _startOffsetFromBall = transform.position.y - _platformScript.transform.position.y;

        _state = State.Rolling;

        _holeFX = GameObject.Find("Hole Sound Effects").GetComponent <HoleSoundEffects>();
    }
コード例 #3
0
    void Start()
    {
        _gyroscope         = Input.gyro;
        _gyroscope.enabled = true;

        _quitBar = GameObject.Find("Bar").GetComponent <RectTransform>();
        _quitBar.gameObject.SetActive(false);
        _quitBarSize = _quitBar.localScale;

        _helpText = GameObject.Find("HelpText");
        _helpText.SetActive(false);
        _creditsText = GameObject.Find("CreditsText");
        _creditsText.SetActive(false);

        _ballScript           = GameObject.Find("Ball").GetComponent <Ball>();
        _wallScript           = GameObject.Find("Main Wall").GetComponent <Wall>();
        _platformScript       = GameObject.Find("Player").GetComponent <Platform>();
        _scoreboardScript     = GameObject.Find("Scoreboard").GetComponent <Scoreboard>();
        _ladderThemeScript    = GameObject.Find("Ladder Theme").GetComponent <LadderTheme>();
        _titleAnimationScript = GameObject.Find("Title objects").GetComponent <TitleAnimation>();

        _paused = false;

        _holdQuitTick = 0;
        _holdQuitTime = 1.2f;

        Physics.gravity = _GRAVITY;

        _wallRenders = new List <Renderer>();
        foreach (Transform t in _wallScript.transform)
        {
            _wallRenders.Add(t.GetComponent <Renderer>());
        }

        FileBrowser.SetFilters(false, new FileBrowser.Filter("Images", ".jpg", ".png"));
    }