示例#1
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);
        }
示例#2
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);
        }
示例#3
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());
        }