void Start()
        {
            _spriteRenderer = GetComponent<SpriteRenderer>();

            if (CollectionManager == null)
            {
                if (FindManagerByReference)
                {
                    var man = FindObjectsOfType<PropertiesCollectionProxyManager>();

                    foreach (var item in man)
                    {
                        if (string.CompareOrdinal(ManagerReferenceId, item.ReferenceId) == 0)
                        {
                            CollectionManager = item;
                            break;
                        }
                    }

                    if (CollectionManager = null)
                    {
                        Debug.LogError(string.Format("Could not find an Manager with the Id: {0}", ManagerReferenceId));
                    }
                }
                else
                {
                    Debug.LogError("There is no Manager assigned!");
                }
            }
        }
Exemplo n.º 2
0
        void Start()
        {
            _spriteRenderer = GetComponent <SpriteRenderer>();

            if (CollectionManager == null)
            {
                if (FindManagerByReference)
                {
                    var man = FindObjectsOfType <PropertiesCollectionProxyManager>();

                    foreach (var item in man)
                    {
                        if (string.CompareOrdinal(ManagerReferenceId, item.ReferenceId) == 0)
                        {
                            CollectionManager = item;
                            break;
                        }
                    }

                    if (CollectionManager == null)
                    {
                        Debug.LogError(string.Format("Could not find an Manager with the Id: {0}", ManagerReferenceId));
                    }
                }
                else
                {
                    Debug.LogError("There is no Manager assigned!");
                }
            }
        }