public void UpdateHook(string _stringPlayerLightData) { if (!isServer) { stringPlayerLightData = _stringPlayerLightData; CurrentLight = JsonUtility.FromJson <PlayerLightData>(stringPlayerLightData); UpdatelightSource(); } }
private void Start() { PlayerLightData = new PlayerLightData() { Intensity = Intensity, Colour = Colour, EnumSprite = EnumSprite, Size = Size, }; }
public void UpdateLight(PlayerLightData Light) { if (!PresentLights.Contains(Light)) { return; } PresentLights.Remove(Light); AddLight(Light); }
public void AddLight(PlayerLightData Light) { if (!(PresentLights.Contains(Light))) { PresentLights.Add(Light); foreach (PlayerLightData Lighte in PresentLights) //The light that is worked out to be in charges chosen by the one that's has the highest intensity { if (Lighte.Intensity > CurrentLight.Intensity) { CurrentLight = Lighte; } } UpdatelightSource(); } }
void Start() { PlayerLightData = new PlayerLightData() { Intensity = Intensity, Colour = Colour, EnumSprite = EnumSprite, Size = Size, }; var pickup = GetComponent <Pickupable>(); if (pickup != null) { pickup.OnPickupServer.AddListener(OnPickupServer); pickup.OnDropServer.AddListener(OnDrop); } }
private void Awake() { PlayerLightData = new PlayerLightData() { Intensity = Intensity, Colour = Colour, EnumSprite = EnumSprite, Size = Size, }; if (objectLightEmission == null) { Logger.LogError($"{this} field objectLightEmission is null, please check {gameObject} prefab.", Category.Lighting); return; } objectLightSprite = objectLightEmission.GetComponent <Light2D.LightSprite>(); }
public void RemoveLight(PlayerLightData Light) { if (PresentLights.Contains(Light)) { PresentLights.Remove(Light); if (CurrentLight == Light) { CurrentLight = DefaultSettings; } foreach (PlayerLightData Lighte in PresentLights) { if (Lighte.Intensity > CurrentLight.Intensity) { CurrentLight = Lighte; } } UpdatelightSource(); } }
private void Awake() { for (int i = 0; i < Sprites.Count; i++) { DictionarySprites[NameSprite[i]] = Sprites[i]; } DefaultSettings = new PlayerLightData() { Intensity = DefaultIntensity, Colour = DefaultColour, //Sprite = DefaultSprite, EnumSprite = DefaultEnumSprite, Size = DefaultSize, }; CurrentLight = DefaultSettings; if (mLightRendererObject == null) { mLightRendererObject = LightSpriteBuilder.BuildDefault(gameObject, new Color(0, 0, 0, 0), 12); } UpdatelightSource(); }
public bool ContainsLight(PlayerLightData Light) { return(PresentLights.Contains(Light)); }