private void Awake() { Instance = this; // Place every ball in a random position between Min_ and Max_ foreach (var ball in Balls) { ball.transform.position = new Vector3(Random.Range(MinX, MaxX), Random.Range(MinY, MaxY), Random.Range(MinZ, MaxZ)); } }
private void Awake() { if (_instance != null) { Destroy(gameObject); } else { _instance = this; } }
public void Init(BallsManager ballsManager, CorridorsConductor corridorsConductor, BonusManager bonusManager, PlayerController playerController, LeaderBoard leaderBoard, ExplosionBonus explosionBonus) { _ballsManager = ballsManager; _ballsManager.Initialize(corridorsConductor); _bonusManager = bonusManager; _playerController = playerController; _leaderBoard = leaderBoard; _explosionBonus = explosionBonus; }
private void ChangeBall() { ScoreManager.Instance.AddScore(1); _ballsManager = BallsManager.Instance; //Change texture ShapeRenderer.material.mainTexture = _ballsManager.ToTexture; //Add physics RB.constraints = RigidbodyConstraints.None; RB.useGravity = true; enabled = true; }
public void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else if (instance != this) { Destroy(gameObject); } }
private void Awake() { if (Instance == null) { Instance = this; } else { Debug.LogError("There's 2 BallsManager ingame"); Destroy(this); } ballsList = new List <GameObject>(); }
private void Awake() { if (_instance != null && _instance != this) { Destroy(gameObject); return; } else { _instance = this; //DontDestroyOnLoad(this.gameObject); } }
void Start() { all.SetActive(false); #if UNITY_ANDROID siempreAtaja = false; #endif introScreen = GetComponent <IntroScreen> (); introScreen.OnIntroScreen(); ballsManager = GetComponent <BallsManager> (); ia = GetComponent <IA> (); resultsManager = GetComponent <ResultsManager> (); Events.OnShoot += OnShoot; m_VRInput.OnDown += OnDown; m_VRInput.OnUp += OnUp; Events.OnStartAgain += OnStartAgain; Events.Goal += Goal; }
public Model() { ballsManager = new BallsManager(); Main.Store.timeIsRuning.Bind(s => Time.timeScale = s ? 1 : 0); Main.Store.gameStatus.Bind(s => { if (s != GameStatus.Playing) { Time.timeScale = 0; } }); Main.Store.blocksCount.LazyBind(s => { if (s == 0) { Main.Store.gameStatus.Value = GameStatus.Loose; } }); Main.Store.levelID.LazyBind(s => { CurrentLevel = s; SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); }); }
private void Start() { _ballsManager = BallsManager.Instance; Anim.SetTrigger("StartWalk"); SetNewBallTarget(); }