Example #1
0
    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;
     }
 }
Example #3
0
    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;
    }
Example #4
0
 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;
 }
Example #5
0
    public void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }

        else if (instance != this)
        {
            Destroy(gameObject);
        }
    }
Example #6
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Debug.LogError("There's 2 BallsManager ingame");
         Destroy(this);
     }
     ballsList = new List <GameObject>();
 }
Example #7
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(gameObject);
         return;
     }
     else
     {
         _instance = this;
         //DontDestroyOnLoad(this.gameObject);
     }
 }
Example #8
0
    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;
    }
Example #9
0
 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);
     });
 }
Example #10
0
 private void Start()
 {
     _ballsManager = BallsManager.Instance;
     Anim.SetTrigger("StartWalk");
     SetNewBallTarget();
 }