コード例 #1
0
ファイル: RiftManager.cs プロジェクト: jceipek/Equilibrium
    void Awake()
    {
        // Only allow one in a scene
        if (g != null) {
            DestroyImmediate(gameObject);
            return;
        }

        g = this;
    }
コード例 #2
0
    private void OnTriggerEnter2D(Collider2D collider)
    {
        if (riftsInViewList.Count == 0)
        {
            activeRift = this;
            riftIndex  = 0;
        }

        riftsInViewList.Add(this);
    }
コード例 #3
0
        public override void Update(TimeSpan time)
        {
            UpdateSessions(time);

            _updateUnitsTimer.Update(time).IsPassed(ProcessUpdatedUnits);

            UpdateUnits(time);

            RiftManager?.Update(time);
            MiningLogHandler.Update(time);
            MeasureUpdate(time);
        }
コード例 #4
0
    private void ChangeActiveRift(int step)
    {
        riftIndex += step;

        if (riftIndex >= riftsInViewList.Count)
        {
            riftIndex = 0;
        }
        else if (riftIndex < 0)
        {
            riftIndex = riftsInViewList.Count - 1;
        }

        if (riftIndex == -1)
        {
            activeRift = null;
        }
        else
        {
            activeRift = riftsInViewList[riftIndex];
        }
    }