public EventTriggerTarget AddNew()
        {
            var targ = new EventTriggerTarget();

            _targets.Add(targ);
            return(targ);
        }
Exemple #2
0
        public void ConfigureTriggerAll(UnityEngine.Object targ, object arg = null)
        {
            if (targ == null)
            {
                throw new System.ArgumentNullException("targ");
            }
            if (GameObjectUtil.IsGameObjectSource(targ))
            {
                this.ConfigureTriggerAll(GameObjectUtil.GetGameObjectFromSource(targ));
                return;
            }
            else if (!EventTriggerTarget.IsValidTriggerTarget(targ, TriggerActivationType.TriggerAllOnTarget))
            {
                throw new System.ArgumentException("Must be a game object source of some sort.", "targ");
            }

            this._triggerable = targ;
            if (arg == null)
            {
                this._triggerableArgs = null;
            }
            else
            {
                this._triggerableArgs = new VariantReference[] { new VariantReference(arg) };
            }
            this._activationType = TriggerActivationType.TriggerAllOnTarget;
            this._methodName     = null;
        }