Exemplo n.º 1
0
    public void InitPointsAndMoney()
    {
        int pointsValue = GlobalOptions.GetGuiLayer().GetPoints();
        int moneyValue  = GlobalOptions.GetGuiLayer().GetMoney();

        points.text = string.Format("{0}", pointsValue);
        money.text  = string.Format("{0}", moneyValue);
    }
Exemplo n.º 2
0
    private void MakeOnTouch()
    {
        int numberOfBoxes = PersonInfo.post;

        GlobalOptions.GetGuiLayer().AddMoney(numberOfBoxes * Random.Range(100, 300));
        PersonInfo.AddPost(-PersonInfo.post);
        GlobalOptions.GetScreenLoader().LoadScreenByName("ScreenGameOver");
    }
Exemplo n.º 3
0
 protected virtual void Update()
 {
     if (state == NotifierStates.SHOWN && Time.time - flyOutTime > SHOW_TIME)
     {
         GlobalOptions.GetGuiLayer().AddCurrentMission(this);
         FlyOut();
     }
 }
Exemplo n.º 4
0
    private void UpdatePoints()
    {
        int          points = GlobalOptions.GetGuiLayer().GetPoints();
        tk2dTextMesh textMesh;

        textMesh      = GuiScore.GetComponent <tk2dTextMesh>();
        textMesh.text = string.Format("{0:000000000}", points);
        textMesh.Commit();
    }
Exemplo n.º 5
0
 void Start()
 {
     GuiLayer             = GlobalOptions.GetGuiLayer();
     playerScript         = GlobalOptions.GetPlayerScript();
     playertransform      = GlobalOptions.GetPlayerScript().singleTransform;
     characterTransform   = playerScript.Character.transform;
     walkingBearTransform = playerScript.GetWalkingBear();
     initEnemy();
 }
Exemplo n.º 6
0
    private void UpdateHP()
    {
        int          hp = GlobalOptions.GetGuiLayer().GetHP();
        tk2dTextMesh textMesh;

        textMesh      = GuiHP.GetComponent <tk2dTextMesh>();
        textMesh.text = string.Format("{0:00}", hp);
        textMesh.Commit();
    }
Exemplo n.º 7
0
 override protected void MakeOnTouch()
 {
     if (GlobalOptions.gameState == GameStates.GAME_OVER)
     {
         if (PersonInfo.TryToBuy(0, boostPriceGold))
         {
             GlobalOptions.GetGuiLayer().MakeRessButtonPushed();
         }
     }
 }
Exemplo n.º 8
0
 public void ResumeGameScreen()
 {
     GlobalOptions.GetGuiLayer().ResumeTimer();
     if (ActiveScreen)
     {
         PrevActive = ActiveScreen;
         ActiveScreen.HideScreen();
         Debug.Log("Hide " + ActiveScreen.gameObject.name);
     }
 }
Exemplo n.º 9
0
 override protected void MakeOnTouch()
 {
     if (GlobalOptions.gameState == GameStates.GAME)
     {
         if (PersonInfo.TryToBuy(boostPrice, 0))
         {
             GlobalOptions.GetGuiLayer().MakeHeadStartButtonPushed(headStartDistance);
         }
     }
 }
Exemplo n.º 10
0
    protected override void Start()
    {
        //transforms
        whereToLookTransform = WhereToLook.transform;
        characterTransform   = Character.transform;
        mainCameraTransform  = MainCamera.transform;
        particlesTransform   = Particles.transform;

        walkingBear          = characterTransform.FindChild("WalkingBear").gameObject;
        walkingBearTransform = walkingBear.transform;
        ////////////

        characterMarioC                 = Character.GetComponent <CharacterMarioC>();
        PlayerFirstPos                  = singleTransform.position;
        CameraFirstPos                  = mainCameraTransform.position;
        CameraFirstRotation             = mainCameraTransform.rotation;
        CharacterFirstPos               = characterTransform.localPosition;
        firstWhereToLookLocalPos        = whereToLookTransform.localPosition;
        raznFromWhereToLookAndCharacter = firstWhereToLookLocalPos - CharacterFirstPos;


        HeadStarsParticleEmitter = GameObject.Find("HeadBoomParticle").GetComponent <ParticleEmitter>();

        GlobalOptions.playerVelocity = startVelocity;
        bearAnimation = Character.GetComponent("BearAnimation3D") as BearAnimation3D;
        bearAnimation.SetWalkSpeed(GetRealVelocityWithNoDeltaTime() / startVelocity);
        force             = 0;
        touchPriority     = 3;
        swallowTouches    = false;
        PathNumber        = 0;
        prevPathNumber    = 0;
        PathChanging      = false;
        VelocityVodka     = 1;
        VelocityHeadStart = 1;
        VelocityPosilka   = 1;
        oldMetersz        = 0;
        oneMeterz         = 0;
        allMeters         = 0;
        flagPosilka       = false;
        flagYahoo         = false;
        timerAltWalk      = Time.time;

        stopTime      = 0;
        startstopTime = 0;

        accelPriority  = 1;
        swallowAcceles = false;

        init();

        guiLayer = GlobalOptions.GetGuiLayer();
        GlobalOptions.gameState                = GameStates.GAME;
        GlobalOptions.playerStates             = PlayerStates.WALK;
        GlobalOptions.playerStatesPathChanging = PlayerStatesPathChanging.FORWARD;
    }
Exemplo n.º 11
0
    private void UpdateTime()
    {
        float        nullTime = GlobalOptions.GetGuiLayer().GetTime();
        tk2dTextMesh textMesh;

        textMesh = GuiTime.GetComponent <tk2dTextMesh>();
        int min, sec;

        min           = (int)nullTime / 60;
        sec           = (int)nullTime % 60;
        textMesh.text = string.Format("{0:00}:{1:00}", min, sec);
        textMesh.Commit();
    }
Exemplo n.º 12
0
 public void BounceStopped()
 {
     curTime--;
     if (curTime > 0)
     {
         crmFont.text = curTime.ToString();
         animation.Rewind();
         animation.Play("Bounce");
     }
     else
     {
         Destroy(gameObject);
         GlobalOptions.GetGuiLayer().Resume();
     }
 }
Exemplo n.º 13
0
    //Корректное создание миссии
    //Только так она создастся правильно
    protected Mission InstantiateMission(Mission missionPrefab)
    {
        string  id      = (string)prefabKeyDictionary [missionPrefab];
        Mission mission = (Instantiate(missionPrefab) as Mission);

        mission.singleTransform.parent = singleTransform;
        mission.AddMissionListener(this);
        mission.SetId(id);
        mission.SetPriority(GetPriority());
        if (GlobalOptions.gameState == GameStates.GAME)
        {
            GlobalOptions.GetGuiLayer().AddMission(mission);              //notify
        }
        return(mission);
    }
Exemplo n.º 14
0
    public static void FinishTutorial()
    {
        PlayerPrefs.SetInt(TAG + "tutorial", 1);
        MissionEmmitters missionEmmitters = GlobalOptions.GetMissionEmmitters();

        if (missionEmmitters != null)
        {
            missionEmmitters.Init();
        }
        GuiLayerInitializer guiLayer = GlobalOptions.GetGuiLayer();

        if (guiLayer != null)
        {
            guiLayer.upNotifierController.AddTutorialFinihsedNotifier();
            guiLayer.upNotifierController.SetCurrentMissions();
        }
    }
Exemplo n.º 15
0
 public void BoostFinished(Boost boost)     //Переписать бы надо, а что делать(
 {
     FlyOut();
     if (boost.GetType() == typeof(VodkaBoost))
     {
         GlobalOptions.GetGuiLayer().StopVodka();
     }
     if (boost.GetType() == typeof(MagnitBoost))
     {
         GlobalOptions.GetGuiLayer().StopMagnit();
     }
     if (boost.GetType() == typeof(X2Boost))
     {
         GlobalOptions.GetGuiLayer().StopX2();
     }
     if (boost.GetType() == typeof(HeadStartBoost))
     {
         GlobalOptions.GetGuiLayer().StopHeadStart();
     }
     Destroy(boost.gameObject);
 }
Exemplo n.º 16
0
 public override void ShowOnScreen()
 {
     base.ShowOnScreen();
     PersonInfo.AddCoins(GlobalOptions.GetGuiLayer().GetMoney());
 }
Exemplo n.º 17
0
 protected override void MakeOnStop()
 {
     GlobalOptions.GetGuiLayer().ShowGameOverScreen();
 }