Example #1
0
    public override bool CreateNeedModels()
    {
        if (MainObj != null)
        {
            return(true);
        }
        if (m_npcInfo == null)
        {
            Debug.LogError("npc CreateNeedModels fail, id=" + ID + ",tableid=" + IDInTable);
            return(false);
        }
        ENNpcType npcType   = (ENNpcType)m_npcInfo.Type;
        string    npcPrefab = "Model/EnemyB";

        switch (npcType)
        {
        case ENNpcType.enBlockNPC:
        case ENNpcType.enFunctionNPC:
        case ENNpcType.enBoxNPC:
            npcPrefab = "Model/EnemyA";
            break;

        case ENNpcType.enBOSSNPC:
            npcPrefab = "Model/EnemyBoss";
            BaseMass  = 100;
            break;

        case ENNpcType.enCommonNPC:
            break;
        }

        if (CanNotBeAttack())
        {
            Load(npcPrefab, m_npcInfo.ModelId, m_npcInfo.ModelScale, WeaponType);
            ActionControl.AddDisableCount(ActorAction.ENType.enSpasticityAction);
        }
        else
        {
            Load(npcPrefab, m_npcInfo.ModelId, m_npcInfo.ModelScale, WeaponType);
        }
        return(true);
    }