Example #1
0
        //unity

        private void BeginGame()
        {
            //create canyon
            canyon = GameObjectsFactory.getInstance().Create <Canyon>();
            canyon.Generate(difficulty);
            finishMarker = GameObjectsFactory.getInstance().Create <FinishMarker>();
            finishMarker.transform.position   = canyon.GetExitPoint();
            finishMarker.transform.localScale = new Vector3(20, 1, 0);
            finishMarker.onHitFinish         += OnHitFinish;

            //setup player if not yet
            if (player == null)
            {
                player = Instantiate(GameObjectsFactory.getInstance().playerPrefab);
                player.SetControl(control);
                player.SetPhysicsl(physics);
                player.SetPScore(score);
                cameraManager.SetTarget(player.gameObject);
            }

            RespawnPlayer();

            if (uiManager.isFirstStart)
            {
                uiManager.isFirstStart = false;
            }

            PlaySnowIfNeeded();

            isFinish         = false;
            Cursor.lockState = CursorLockMode.Locked;
        }
Example #2
0
File: Player.cs Project: kro13/KK
 private void EmitScore(int val)
 {
     if (Mathf.Abs(val) > 0)
     {
         Points points = GameObjectsFactory.getInstance().Create <Points>();
         points.transform.position = transform.position;
         points.SetValue(val);
     }
 }