Esempio n. 1
0
    public Creature CreateSceneActor(int rMonsterId, Vector3_ rPos, CreatureDirection rDir, int rGroup, int rLevel)
    {
        MonsterCreature actor = MonsterCreature.CreateMonster(rMonsterId, rGroup, rLevel, rPos, Vector3_.zero);

        if (!actor)
        {
            return(null);
        }

        actor.isBoss            = false;
        actor.enabledAndVisible = true;
        actor.invincibleCount   = int.MaxValue;
        actor.behaviour.hitCollider.isTrigger = false;
        actor.checkEdge = false;
        actor.SetHealthBarVisible(false);
        actor.forceDirection = (int)rDir;

        return(actor);
    }
Esempio n. 2
0
    /// <summary>
    /// 创建monster/sceneactor
    /// </summary>
    /// <param name="b"></param>
    private void RealCreateMonster(SceneEventInfo.SceneBehaviour b)
    {
        if (b.sceneBehaviorType == SceneEventInfo.SceneBehaviouType.CreateMonster)
        {
            SCreateMonsterBehaviour cmb     = new SCreateMonsterBehaviour(b, null);
            MonsterCreature         monster = MonsterCreature.CreateMonster(cmb.monsterId, cmb.group, cmb.level, Vector3_.right * cmb.reletivePos, new Vector3(0, 90f, 0), Module_PVE.instance?.currrentStage);
            if (!monster)
            {
                return;
            }

            monster.enabledAndVisible = false;
            if (sceneRoot)
            {
                monster.transform.SetParent(sceneRoot);
            }
            creaturePool.Add(monster);
        }
        else if (b.sceneBehaviorType == SceneEventInfo.SceneBehaviouType.CreateSceneActor)
        {
            SCreateSceneActorBehaviour csab    = new SCreateSceneActorBehaviour(b, null);
            MonsterCreature            monster = MonsterCreature.CreateMonster(csab.sceneActorId, csab.group, csab.level, Vector3_.zero + Vector3_.right * csab.reletivePos, new Vector3(0, 90f, 0), Module_PVE.instance?.currrentStage);
            monster.roleId = (ulong)csab.logicId;
            if (!monster)
            {
                return;
            }

            monster.enabledAndVisible = false;
            if (sceneRoot)
            {
                monster.transform.SetParent(sceneRoot);
            }
            sceneActorPool.Add(monster);
        }
    }