Ejemplo n.º 1
0
        public void OnDrawGizmos()
        {
            int count = ActiveRequests.Count;

            for (int i = count - 1; i >= 0; --i)
            {
                FCgGizmoDrawRequest request = ActiveRequests[i];

                if (request.HasCompleted())
                {
                    request.Reset();
                    ActiveRequests.RemoveAt(i);

#if UNITY_EDITOR
                    FCgPlayInEditor.Get().ClearGizmoField();
#endif // #if UNITY_EDITOR
                    continue;
                }
                else
                {
                    request.Draw();
                }

                // Frame
                request.UpdateFrame();
                // Time
                request.UpdateTime(Time.deltaTime);
            }
        }
Ejemplo n.º 2
0
        public virtual void Init()
        {
            if (_Instance != null)
            {
                return;
            }

            _Instance = this;

            OnExitingPlayMode_Event = new FOnExitingPlayMode();

            ObjectMap = new Dictionary <ulong, ICgObject>();

            MCgDataMapping.Init();
            FCgManager_Prefab.Get().Init();

#if UNITY_EDITOR
            FCgPlayInEditor.Get();
#endif // #if UNITY_EDITOR

            // Set Editor Callbacks
#if UNITY_EDITOR
            EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
#endif // #if UNITY_EDITOR
        }
Ejemplo n.º 3
0
        public void DrawSphere(Vector3 center, float radius, Color color, float time)
        {
            FCgGizmoDrawRequest request = AllocateRequest();

            request.Shape     = ECgGizmoDrawShape.Sphere;
            request.DrawColor = color;
            request.SphereParams.Set(center, radius);
            request.bWaitForTime = true;
            request.WaitForTime  = time;

            ActiveRequests.Add(request);

#if UNITY_EDITOR
            FCgPlayInEditor.Get().SetGizmoField();
#endif // #if UNITY_EDITOR
        }
Ejemplo n.º 4
0
        public void DrawRay(Vector3 from, Vector3 direction, Color color, float time)
        {
            FCgGizmoDrawRequest request = AllocateRequest();

            request.Shape     = ECgGizmoDrawShape.Ray;
            request.DrawColor = color;
            request.RayParams.Set(from, direction);
            request.bWaitForTime = true;
            request.WaitForTime  = time;

            ActiveRequests.Add(request);

#if UNITY_EDITOR
            FCgPlayInEditor.Get().SetGizmoField();
#endif // #if UNITY_EDITOR
        }