TimeOfDayManager.AmIadded C# (CSharp) Méthode

AmIadded() public méthode

public AmIadded ( ObjectProperties, objectProperties ) : void
objectProperties ObjectProperties,
Résultat void
    public void AmIadded(ObjectProperties objectProperties)
    {
        //if (props != null)
        if (!props.Contains(objectProperties) && !suns.Contains(objectProperties) && !instantUpdate.Contains(objectProperties)) {
            // TODO move to event system or send message or observables etc
            Debug.LogWarning(objectProperties.gameObject.name + " was not added so finding all ObjectProperties, bad for performance!", objectProperties.gameObject);
            SeekItems();
        }
    }

Usage Example

Exemple #1
0
    public void OnEnable()
    {
        if (debugLogness)
        {
            Debug.Log("Enable Properties", this);
        }
        if (timeOfDayManager == null)
        {
            Debug.LogWarning("no timeOfDayManager found, so finding one now ( you should make sure TimeOfDayManager runs first and finds all objects it wants to control", this); // If a TimeOfDayManager fails to claim this as something for it to control, the item itself can find a TimeOfDayManager and tell it to control it, this is expensive at the moment as each time this happens it requests the TimeOfDayManager seek all scene objects, so is used in emergency only hence the above warning
            timeOfDayManager = FindObjectOfType <TimeOfDayManager>();                                                                                                             // may have multiple managers in future so bad
        }


        if (timeOfDayManager != null)
        {
            timeOfDayManager.AmIadded(this);                                   // For editor use
        }
        if (mirrorLight)
        {
            mirror();
        }
        Setup();
        hasSetup = true;
        Run();
    }