public void SetChar(string CharName, NkCharIDInfo IDInfo, bool RealActor, bool Hide)
 {
     if (this._IDInfo == null)
     {
         this._IDInfo = IDInfo;
         this._ActorAction.Add(new MiniDramaActorController.ActorMake(CharName, IDInfo.m_nClientID, base.gameObject, RealActor, Hide));
     }
 }
        public bool AddActor(string ActorName, NkCharIDInfo IDInfo, bool Actor, bool bHide)
        {
            if (this.IsActor(ActorName))
            {
                TsLog.LogWarning(string.Format("[EventTriggerMiniDrama] ActorManager : Have Equal CharName {0}", ActorName), new object[0]);
                return(false);
            }
            GameObject gameObject = new GameObject(typeof(MiniDramaActorController).Name);

            TsSceneSwitcher.Instance.Collect(TsSceneSwitcher.ESceneType.WorldScene, gameObject);
            MiniDramaActorController miniDramaActorController = gameObject.AddComponent <MiniDramaActorController>();

            miniDramaActorController.SetChar(ActorName, IDInfo, Actor, bHide);
            this.m_ActorControllerList.Add(ActorName, miniDramaActorController);
            return(true);
        }
        public bool AddChar(string ActorName, string CharKindCode, float X, float Y, int Angle, bool Hide)
        {
            if (string.IsNullOrEmpty(ActorName) || string.IsNullOrEmpty(CharKindCode))
            {
                return(false);
            }
            if (this.IsActor(ActorName))
            {
                TsLog.LogWarning(string.Format("[EventTriggerMiniDrama] ActorManager : Have Equal CharName {0}", ActorName), new object[0]);
                return(false);
            }
            NrCharKindInfo charKindInfoFromCode = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfoFromCode(CharKindCode);

            if (charKindInfoFromCode == null)
            {
                return(false);
            }
            NEW_MAKECHAR_INFO nEW_MAKECHAR_INFO = new NEW_MAKECHAR_INFO();

            nEW_MAKECHAR_INFO.CharName  = TKString.StringChar(charKindInfoFromCode.GetName());
            nEW_MAKECHAR_INFO.CharPos.x = X;
            nEW_MAKECHAR_INFO.CharPos.y = EventTriggerGameHelper.GetGroundPosition(X, Y);
            nEW_MAKECHAR_INFO.CharPos.z = Y;
            float f = (float)Angle * 0.0174532924f;

            nEW_MAKECHAR_INFO.Direction.x  = 1f * Mathf.Sin(f);
            nEW_MAKECHAR_INFO.Direction.y  = 0f;
            nEW_MAKECHAR_INFO.Direction.z  = 1f * Mathf.Cos(f);
            nEW_MAKECHAR_INFO.CharKind     = charKindInfoFromCode.GetCharKind();
            nEW_MAKECHAR_INFO.CharKindType = 3;
            nEW_MAKECHAR_INFO.CharUnique   = NrTSingleton <NkQuestManager> .Instance.GetClientNpcUnique();

            int id = NrTSingleton <NkCharManager> .Instance.SetChar(nEW_MAKECHAR_INFO, false, false);

            NrCharBase @char = NrTSingleton <NkCharManager> .Instance.GetChar(id);

            NkCharIDInfo nkCharIDInfo = new NkCharIDInfo();

            nkCharIDInfo.m_nClientID   = @char.GetID();
            nkCharIDInfo.m_nCharUnique = @char.GetCharUnique();
            nkCharIDInfo.m_nWorldID    = @char.GetWorldID();
            @char.SetExceptHideForLoad(true);
            return(this.AddActor(ActorName, nkCharIDInfo, true, Hide));
        }