Пример #1
0
        static void CreateLight(MenuCommand menuCommand, string name, Light2D.LightType type)
        {
            GameObject go      = ObjectFactory.CreateGameObject(name, typeof(Light2D));
            Light2D    light2D = go.GetComponent <Light2D>();

            light2D.lightType = type;

            var parent = menuCommand.context as GameObject;

            Place(go, parent);

            Analytics.Light2DData lightData = new Analytics.Light2DData();
            lightData.was_create_event = true;
            lightData.instance_id      = light2D.GetInstanceID();
            lightData.light_type       = light2D.lightType;
            Analytics.Renderer2DAnalytics.instance.SendData(Analytics.AnalyticsDataTypes.k_LightDataString, lightData);
        }
Пример #2
0
        static void CreateLight(MenuCommand menuCommand, Light2D.LightType type, Vector3[] shapePath = null)
        {
            GameObject go      = ObjectFactory.CreateGameObject("Light 2D", typeof(Light2D));
            Light2D    light2D = go.GetComponent <Light2D>();

            light2D.lightType = type;

            if (shapePath != null && shapePath.Length > 0)
            {
                light2D.shapePath = shapePath;
            }

            var parent = menuCommand.context as GameObject;

            Place(go, parent);

            Analytics.Light2DData lightData = new Analytics.Light2DData();
            lightData.was_create_event = true;
            lightData.instance_id      = light2D.GetInstanceID();
            lightData.light_type       = light2D.lightType;
            Analytics.Renderer2DAnalytics.instance.SendData(Analytics.AnalyticsDataTypes.k_LightDataString, lightData);
        }