//重新设置效果物体 void SkillObjectEditor::ResetSkillObject() { Fairy::LogicModel* pDObject = m_Frame->GetActorSettingEditor()->GetActorObject(); if(!pDObject) return; //pDObject->execute(0.0f); try { pDObject->createSkill( mSkillTemplateName, m_Frame->GetGraphDialog()->GetLoop()); if(mSkill->getNumAnimationBulletFlows() > 0) { BulletFlowInfo* pInfo = new BulletFlowInfo; Fairy::AnimationBulletFlow* pAnimationFlow = mSkill->getAnimationBulletFlow(0); pInfo->attachPoint = pAnimationFlow->getAttachPoint(); pInfo->offsetPoistion = pAnimationFlow->getOffsetPos(); pInfo->offsetRotation = pAnimationFlow->getOffsetRotation(); pInfo->casterModel = m_Frame->GetActorSettingEditor()->GetCurrentObject(); pInfo->targetModel = m_Frame->GetActorSettingEditor()->GetTargetObject(); pInfo->targetPoint = "身体中心点"; pDObject->getCurrentSkill()->m_userData = pInfo; } } catch ( Ogre::Exception& e) { } //mSkill = Fairy::EffectManager::getSingleton().getSkill(mSkillTemplateName); m_Frame->GetGraphDialog()->InitSkillEditor(mSkill,mSkillTemplateName); }
Fairy::Skill* SkillObjectEditor::getCurrentObjectSkill() { Fairy::LogicModel* pDObject = m_Frame->GetActorSettingEditor()->GetActorObject(); if(pDObject) { return pDObject->getCurrentSkill(); } return NULL; }
void SkillObjectEditor::InitSkillEditor(Fairy::Skill* pSkill,Ogre::String& templateName) { mSkillTemplateName = templateName; mSkill = pSkill; GetParentFrame()->GetEffectObjectProperty()->InitSkillEditor(mSkill,templateName); m_SkillObjectTree->DeleteAllItems(); m_SkillObjectTree->AddSkillToTree(mSkill); m_SkillObjectTree->SelectSkillSetting(); Fairy::LogicModel* pDObject = m_Frame->GetActorSettingEditor()->GetActorObject(); pDObject->setAnimEditing(false); m_Frame->GetGraphDialog()->InitSkillEditor(mSkill,mSkillTemplateName); m_Frame->GetGraphDialog()->InitAnimTimePosSlider(); try { pDObject->createSkill( mSkill->getSkillName(), m_Frame->GetGraphDialog()->GetLoop()); if(mSkill->getNumAnimationBulletFlows() > 0) { BulletFlowInfo* pInfo = new BulletFlowInfo; Fairy::AnimationBulletFlow* pAnimationFlow = mSkill->getAnimationBulletFlow(0); pInfo->attachPoint = pAnimationFlow->getAttachPoint(); pInfo->offsetPoistion = pAnimationFlow->getOffsetPos(); pInfo->offsetRotation = pAnimationFlow->getOffsetRotation(); pInfo->casterModel = m_Frame->GetActorSettingEditor()->GetCurrentObject(); pInfo->targetModel = m_Frame->GetActorSettingEditor()->GetTargetObject(); pInfo->targetPoint = "身体中心点"; pDObject->getCurrentSkill()->m_userData = pInfo; } } catch ( Ogre::Exception& e) { Ogre::String msg = "[Warning] Animation : " + mSkill->getSkillName() + "_getAnimationState Failed!"; wxLogMessage(msg.c_str()); } mDObject = pDObject; }