Exemplo n.º 1
0
        public AbilityTriggerField CreateAbilityTriggerField(Vector3 initPos, Vector3 initDir, BaseAbilityActor owner, float uniformScale, MixinTargetting targetting, uint runtimeID, bool followOwner = false)
        {
            MonoTriggerField    entity = this.CreateDynamicObjectEntityInstance <MonoTriggerField>(owner.runtimeID, "UnitField", initPos, initDir, runtimeID);
            AbilityTriggerField field2 = Singleton <EventManager> .Instance.CreateActor <AbilityTriggerField>(entity);

            field2.Setup(owner, uniformScale, targetting, followOwner);
            return(field2);
        }
Exemplo n.º 2
0
        public uint CreateStageExitField(uint ownerID, Vector3 initPos, Vector3 initDir)
        {
            MonoTriggerField entity = this.CreateDynamicObjectEntityInstance <MonoTriggerField>(ownerID, "StageExitField", initPos, initDir, this.GetNextSyncedDynamicObjectRuntimeID());

            entity.SetCollisionMask(((int)1) << InLevelData.AVATAR_LAYER);
            StageExitFieldActor actor = Singleton <EventManager> .Instance.CreateActor <StageExitFieldActor>(entity);

            Singleton <EffectManager> .Instance.TriggerEntityEffectPattern("Prop_LevelGoal", entity, true);

            return(actor.runtimeID);
        }
Exemplo n.º 3
0
        public uint CreateMonsterExitField(uint ownerID, Vector3 initPos, Vector3 initDir, bool forDefendMode = false)
        {
            MonoTriggerField entity = this.CreateDynamicObjectEntityInstance <MonoTriggerField>(ownerID, "StageMonsterExitField", initPos, initDir, this.GetNextSyncedDynamicObjectRuntimeID());

            entity.SetCollisionMask(((int)1) << InLevelData.MONSTER_LAYER);
            MonsterExitFieldActor triggerFieldActor = Singleton <EventManager> .Instance.CreateActor <MonsterExitFieldActor>(entity);

            Singleton <EffectManager> .Instance.TriggerEntityEffectPattern("Prop_LevelMonsterGoal", entity, true);

            if (forDefendMode)
            {
                Singleton <LevelManager> .Instance.levelActor.AddTriggerFieldInDefendMode(triggerFieldActor);
            }
            return(triggerFieldActor.runtimeID);
        }
Exemplo n.º 4
0
        public uint RegisterStageEnvTriggerField(uint ownerID, GameObject go)
        {
            MonoTriggerField component = go.GetComponent <MonoTriggerField>();

            if (component == null)
            {
                component = go.AddComponent <MonoTriggerField>();
                BaseMonoDynamicObject entity = this.RegisterAsDynamicObject(ownerID, go);
                Singleton <EventManager> .Instance.CreateActor <TriggerFieldActor>(entity);
            }
            component.SetCollisionMask(((int)1) << InLevelData.AVATAR_LAYER);
            Collider collider = component.GetComponent <Collider>();

            collider.enabled = false;
            collider.enabled = true;
            return(component.GetRuntimeID());
        }
Exemplo n.º 5
0
 public override void Init(BaseMonoEntity entity)
 {
     this._triggerField = (MonoTriggerField)entity;
     base.runtimeID     = this._triggerField.GetRuntimeID();
     Singleton <EventManager> .Instance.FireEvent(new EvtStageTriggerCreated(base.runtimeID), MPEventDispatchMode.Normal);
 }
Exemplo n.º 6
0
 public override void Init(BaseMonoEntity entity)
 {
     this.triggerField = (MonoTriggerField)entity;
     base.runtimeID    = this.triggerField.GetRuntimeID();
 }