コード例 #1
0
ファイル: RuneTile.cs プロジェクト: arhpositive/GGJ2016
 void Awake()
 {
     _spriteRenderer = GetComponent<SpriteRenderer>();
     OnLeftTeam = transform.position.x <= 14.5 ? true : false;
     _leftPlayerScript = GameObject.FindGameObjectWithTag("LeftPlayer").GetComponent<BasePlayer>();
     _levelManagerScript = Camera.main.GetComponent<LevelManager>();
 }
コード例 #2
0
ファイル: GameManager.cs プロジェクト: alkozlov/Kosorub
        private void Awake()
        {
            //Check if Instance already exists
            if (Instance == null)
            {
                //if not, set Instance to this
                Instance = this;
            }
            //If Instance already exists and it's not this:
            else
            {
                if (Instance != this)
                {
                    //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one Instance of a GameManager.
                    Destroy(this.gameObject);
                }
            }

            //Sets this to not be destroyed when reloading scene
            DontDestroyOnLoad(this.gameObject);

            this._levelManager = this.GetComponent<LevelManager>();
            this._uiManager = this.GetComponent<UIManager>();

            this.InitGame();
        }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     _slider = GameObject.FindObjectOfType<Slider>();
     _slider.maxValue = 1;
     _slider.minValue = 0;
     _levelManager = GameObject.FindObjectOfType<LevelManager>();
     _audioSource = GetComponent<AudioSource>();
     _winLabel = GameObject.Find("WinBanner") as GameObject;
     _winLabel.SetActive(false);
 }
コード例 #4
0
 void Start()
 {
     _levelManager = FindObjectOfType<LevelManager>();
 }
コード例 #5
0
 void OnTriggerEnter2D(Collider2D collider)
 {
     //Debug.Log("Trigger");
     LevelManager.LoadLoseLevel();
 }