Exemplo n.º 1
0
        // TODO: I wish these could be in base class ValueReference...
        public override void RegisterListener(GameEvent.GameEventHandler eventHandler, UnityEngine.Object listener)
        {
                    #if UNITY_EDITOR
            if (!Application.isPlaying)
            {
                return;
            }
                    #endif

            //if (ReferenceEquals(listener, null))
            //	return;

            switch (_assignmentType)
            {
            case AssignmentType.PersonalVariable:
                if (ReferenceEquals(_instancedVariable, null) || ReferenceEquals(IDToken, null))
                {
                    return;
                }
                _instancedVariable.RegisterListener(IDToken, eventHandler, listener);
                break;

            case AssignmentType.GlobalVariable:
                if (ReferenceEquals(_globalVariable, null))
                {
                    return;
                }
                _globalVariable.RegisterListener(eventHandler, listener);
                break;

            case AssignmentType.Constant:
            default:
                return;
            }
        }