public void MakeChar() { if (this.m_CenterChar == null || this._MakeCharCodes == null) { UnityEngine.Object.Destroy(base.gameObject); return; } this.MakeComplete = false; base.enabled = true; if (this.m_MakeNpcTable == null) { this.m_MakeNpcTable = new Dictionary <string, SubNpc>(); } for (int i = 0; i < this._MakeCharCodes.Count; i++) { float y = this.m_CenterChar.m_k3DChar.GetRootGameObject().transform.localEulerAngles.y; float num = 0f; int num2 = this._PositionList[i]; if (num2 == -1) { num = y + this.degreeTemp[this._GetEmptySlot()]; } else if (0 <= num2 && 5 > num2) { num = y + this.degreeTemp[num2]; } float f = num * 0.0174532924f; POS3D pOS3D = new POS3D(); pOS3D.x = this.m_CenterChar.GetPersonInfo().GetCharPos().x + 15f * Mathf.Sin(f); pOS3D.y = 0f; pOS3D.z = this.m_CenterChar.GetPersonInfo().GetCharPos().z + 15f * Mathf.Cos(f); float f2 = (num + 180f) * 0.0174532924f; POS3D pOS3D2 = new POS3D(); pOS3D2.x = 1f * Mathf.Sin(f2); pOS3D2.y = 0f; pOS3D2.z = 1f * Mathf.Cos(f2); NrCharBase nrCharBase = this._CreateClientNPC(this._MakeCharCodes[i], pOS3D, pOS3D2); if (nrCharBase != null) { SubNpc subNpc = new SubNpc(); subNpc.i32ID = nrCharBase.GetID(); subNpc.CharCode = nrCharBase.GetCharKindInfo().GetCode(); subNpc.i16CharUnique = nrCharBase.GetCharUnique(); if (!this.m_MakeNpcTable.ContainsKey(nrCharBase.GetCharKindInfo().GetCode())) { this.m_MakeNpcTable.Add(nrCharBase.GetCharKindInfo().GetCode(), subNpc); } } } }
private NrCharBase _CreateClientNPC(string CharCode, POS3D CharPos, POS3D CharDirection) { NrCharKindInfo charKindInfoFromCode = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfoFromCode(CharCode); if (charKindInfoFromCode == null) { return(null); } NEW_MAKECHAR_INFO nEW_MAKECHAR_INFO = new NEW_MAKECHAR_INFO(); nEW_MAKECHAR_INFO.CharName = TKString.StringChar(charKindInfoFromCode.GetName()); nEW_MAKECHAR_INFO.CharPos.x = CharPos.x; nEW_MAKECHAR_INFO.CharPos.y = CharPos.y; nEW_MAKECHAR_INFO.CharPos.z = CharPos.z; nEW_MAKECHAR_INFO.Direction.x = CharDirection.x; nEW_MAKECHAR_INFO.Direction.y = CharDirection.y; nEW_MAKECHAR_INFO.Direction.z = CharDirection.z; nEW_MAKECHAR_INFO.CharKind = charKindInfoFromCode.GetCharKind(); nEW_MAKECHAR_INFO.CharKindType = 3; nEW_MAKECHAR_INFO.CharUnique = (short)(31000 + this._GetEmptySlot()); NrTSingleton <NkCharManager> .Instance.SetChar(nEW_MAKECHAR_INFO, false, false); NrCharBase charByCharUnique = NrTSingleton <NkCharManager> .Instance.GetCharByCharUnique(nEW_MAKECHAR_INFO.CharUnique); if (charByCharUnique != null) { if (charByCharUnique.IsHaveAnimation(eCharAnimationType.TalkStart1)) { charByCharUnique.SetAnimationLoadAfter(eCharAnimationType.TalkStart1); } else if (charByCharUnique.IsHaveAnimation(eCharAnimationType.TalkStay1)) { charByCharUnique.SetAnimationLoadAfter(eCharAnimationType.TalkStay1); } else { charByCharUnique.SetAnimationLoadAfter(eCharAnimationType.Stay1); } } return(charByCharUnique); }
public POS3D[] GetEventArea() { List <POS3D> list = new List <POS3D>(); if (this.EventConditionList != null) { foreach (GameObject current in this.EventConditionList) { EventTriggerItem_EventCondition component = current.GetComponent <EventTriggerItem_EventCondition>(); if (component != null) { POS3D areaEvent = component.GetAreaEvent(); if (areaEvent != null) { list.Add(areaEvent); } } } } return(list.ToArray()); }
public void SetCharPos(POS3D vCharPos) { this.SetCharPos(vCharPos.x, vCharPos.y, vCharPos.z); }
public void SetDirection(POS3D vDirection) { this.SetDirection(vDirection.x, vDirection.y, vDirection.z); }