Пример #1
0
    public void Awake()
    {
        if (asaController == null)
        {
            asaController = this;
        }
        else
        {
            Debug.Log("ASA Controller set twice! Only one instance allowed");
        }

        //Add Asa Manager if on the correct platform
#if !UNITY_EDITOR
        this.gameObject.AddComponent <SpatialAnchorManager>();
#endif
    }
    /// <summary>
    /// Initliazes all references and validates the configuration.
    /// </summary>
    private void InitializeReferences()
    {
        //Look for an asa controller if none is assigned.
        if (asaController == null)
        {
            asaController = FindObjectOfType <ASAController>();
        }

        //If it is still null, no ASAController exists in the scene
        if (asaController == null)
        {
            Debug.Log("No ASA Controller was found. This ASA Status Controller can therefore not do its work");
            return;
        }

        //Hook into the events
        asaController.AsaStatusEventHook += AsaStatusEventHookHandler;
    }