public override void EnterGameHandler()
    {
        base.EnterGameHandler();

        //从这里开始,编写游戏逻辑
        "log".Log(mLog);
        this.LogAndLocated("log", mSampleExplain);
        mLogWithParam.Log(mReloadTime.ToString());
        //GameObject raw = ShipDockApp.Instance.ABs.Get("aa", "a");
        //Instantiate(raw);

        //UIManager UIMgr = ShipDockApp.Instance.UIs;
        //UIMgr.OpenResourceUI<Transform>("ResourceUISample");

        TimeUpdater.New(5f, () =>
        {
            mReloadTime--;
            if (mReloadTime <= 0)
            {
                Destroy(GameComponent.gameObject);//通过销毁框架模板组件所在的物体,达到关闭框架的目的
            }
            else
            {
                ReloadFrameworkScene();//使用此方法从新加载框架启动组件所在场景,达到重启框架的目的
            }
        });
    }
Beispiel #2
0
    public static void Main(string[] args)
    {
        TimeUpdater t    = new TimeUpdater();
        string      time = t.updateToInternetTime();

        Console.Out.WriteLine("OS time updated to: " + time);
        System.Threading.Thread.Sleep(2500);
        // Console.In.ReadLine();
    }
Beispiel #3
0
 void Start()
 {
     if (!destroyed)
     {
         scoreUpdater = GameObject.FindGameObjectWithTag("Score").GetComponent <ScoreUpdater>();
         scoreUpdater.RegisterPickup();
         timeUpdater = GameObject.FindGameObjectWithTag("Time").GetComponent <TimeUpdater>();
         registered  = true;
     }
 }
Beispiel #4
0
    public override void EnterGameHandler()
    {
        base.EnterGameHandler();

        Scenes scenes = new Scenes();

        scenes.OnSceneLoaded += (s, m) =>
        {
            scenes.OnSceneLoaded = default;
            TimeUpdater.New(5f, () =>
            {
                scenes.ClearAndLoadScene("LoadSceneSampleB", "LoadSceneSampleA");
            });
        };
        scenes.ClearAndLoadScene("LoadSceneSampleA", string.Empty);
    }
Beispiel #5
0
    void Update()
    {
        if (executing)
        {
            camSpeed += cameraAcceleration;

            if (camSpeed > maxSpeed)
            {
                camSpeed = maxSpeed;
            }

            rotY += camSpeed;

            if (shakingUp)
            {
                rotX += shakeFactor;
            }
            else
            {
                rotX -= shakeFactor;
            }

            if (shakingUp && rotX >= maxShakeHeight)
            {
                rotX      = maxShakeHeight;
                shakingUp = false;
            }
            else if (!shakingUp && rotX <= -maxShakeHeight)
            {
                rotX      = -maxShakeHeight;
                shakingUp = true;
            }

            cam.transform.eulerAngles = new Vector3(rotX, rotY, 0);

            if (winAnimation.GetTimePassed() >= winAnimation.durationInSeconds - fadeAnimation.durationInSeconds / 2 && !fadeRunning)
            {
                //fadeAnimationLeft.Begin();
                //fadeAnimationRight.Begin();
                //fadeAnimationFront.Begin();
                //fadeAnimationBack.Begin();
                fadeAnimation.Begin();
                fadeRunning = true;
            }

            currentTime += Time.deltaTime;

            if (currentTime >= timeBetweenBlinks)
            {
                canvas.enabled = !canvas.enabled;
                currentTime    = 0;
            }

            TimeUpdater.running = false;

            if (winAnimation.IsFinished())
            {
                winAnimation.Halt();
                executing      = false;
                canvas.enabled = true;
                RayCastController.level1ObjectsPassed = 0;
                RayCastController.level2ObjectsPassed = 0;
                RayCastController.level3ObjectsPassed = 0;
                titleAnimation.Halt();
                titleAnimation.Begin();
                MoveToNextRoom.MoveToMainRoom();
                TimeUpdater.ResetCounter();
                //SceneManager.LoadScene (SceneManager.GetActiveScene ().name);

                for (int i = 0; i < disabledRoomObjects.Length; i++)
                {
                    disabledRoomObjects [i].Enable();
                }

                soundEmitter1.startClue = false;
                soundEmitter2.startClue = false;
            }
        }

        sendEarthquake.GetComponent <SendCueLocation> ().startClue = executing;
    }
 public void registerTimer(TimeUpdater update_)
 {
     timerRunning = update_;
 }