Exemple #1
0
    //useConfAtt是否使用配表的属性
    public void Init(int actorID, int actorLv, bool useConfAtt, EmActorFaction _actorFaction, EmActorType _actorType)
    {
        actorConf    = DBActorAttributeTable.GetRecord(actorID);
        actorFaction = _actorFaction;
        actorType    = _actorType;

        if (useConfAtt)
        {
            orgAttribute = TqmDatabase.CreateActorAttributeData(actorConf, actorLv);
        }
        else
        {
            orgAttribute = ActorAttributeDataCollection.GetActorAttributeData(actorID);
        }
        curAttribute = TqmDatabase.CloneActorAttributeData(orgAttribute);

        objectbase         = gameObject.GetComponent <ObjectBase>();
        objectcollider     = gameObject.GetComponent <ObjectCollider>();
        audioSource        = gameObject.AddComponent <AudioSource>();
        objectbase.x2dAnim = ResourceLoader.GetX2dAniamtion(actorConf.animationName, transform);

        foreach (int i in actorConf.skillIdList)
        {
            activeSkillList.Add(skillStateManager.GetSkillState(i));
        }

        objectcollider.size = actorConf.size;

        ChangeStatus(EmActorStatus.Idle);
    }
 void Awake()
 {
     instance = this;
 }
 void OnDestroy()
 {
     instance = null;
 }