コード例 #1
0
        internal static ActorBase CreateNativeActor(ActorInitializationParams actorInfo)
        {
#if !(RELEASE && RELEASE_DISABLE_CHECKS)
            if (actorInfo.Id == 0)
            {
                throw new ArgumentException("actorInfo.Id cannot be 0!");
            }
            if (actorInfo.ActorPtr == IntPtr.Zero)
            {
                throw new ArgumentException("actorInfo.ActorPtr cannot be 0!");
            }
            if (actorInfo.EntityPtr == IntPtr.Zero)
            {
                throw new ArgumentException("actorInfo.EntityPtr cannot be 0!");
            }
#endif

            var nativeActor = new NativeActor(actorInfo);
            ScriptManager.Instance.AddScriptInstance(nativeActor, ScriptType.Actor);

            return(nativeActor);
        }
コード例 #2
0
ファイル: NativeActor.cs プロジェクト: yonder/CryMono
 internal NativeActor(ActorInitializationParams actorInfo)
 {
     Id = new EntityId(actorInfo.Id);
     this.SetIEntity(actorInfo.EntityPtr);
     this.SetIActor(actorInfo.ActorPtr);
 }
コード例 #3
0
 internal NativeActor(ActorInitializationParams actorInfo)
 {
     this.Id           = new EntityId(actorInfo.Id);
     this.EntityHandle = actorInfo.EntityPtr;
     this.ActorHandle  = actorInfo.ActorPtr;
 }