Example #1
0
 private ReferenceCountedCoroutine(Facepunch.Load.Utility.ReferenceCountedCoroutine.Runner runner, Facepunch.Load.Utility.ReferenceCountedCoroutine.Callback callback, object yieldInstruction, object tag, bool skipOnce)
 {
     this.runner = runner;
     this.callback = callback;
     this.yieldInstruction = yieldInstruction;
     this.tag = tag;
     this.skipOnce = skipOnce;
 }
Example #2
0
 public bool Push(Facepunch.Geometry.Sphere Sphere, ref Vector3 Velocity)
 {
     Vector vector;
     if (!this.shape.Shape.Intersects(Sphere))
     {
         return false;
     }
     Facepunch.Geometry.Plane plane = Facepunch.Geometry.Plane.DirectionPoint(this.pushDir0, this.pushPoint0);
     Facepunch.Geometry.Plane plane1 = Facepunch.Geometry.Plane.DirectionPoint(this.pushDir1, this.pushPoint1);
     vector = (plane.DistanceTo(Sphere.Center + ((Normal)plane.Direction * Sphere.Radius)) <= plane1.DistanceTo(Sphere.Center + ((Normal)plane1.Direction * Sphere.Radius)) ? (Normal)plane1.Direction * (this.pushSpeed * Time.deltaTime) : (Normal)plane.Direction * (this.pushSpeed * Time.deltaTime));
     Velocity.x = Velocity.x + vector.x;
     Velocity.y = Velocity.y + vector.y;
     Velocity.z = Velocity.z + vector.z;
     return true;
 }
Example #3
0
 public bool PlayAnimation(Facepunch.Movement.GroupEvent GroupEvent, float animationSpeed, float animationTime)
 {
     AnimationState animationState;
     bool flag;
     if (this.movement == null)
     {
         Debug.Log("no Movement");
         return false;
     }
     try
     {
         if (this.movement.GetGroupEvent(GroupEvent, out animationState))
         {
             if (animationTime >= 0f)
             {
                 animationState.normalizedTime = animationTime;
             }
             else
             {
                 animationState.time = -animationTime;
             }
             if (!this.animation.Play(animationState.name, PlayMode.StopSameLayer))
             {
                 return false;
             }
             if (animationState.speed != animationSpeed)
             {
                 animationState.speed = animationSpeed;
             }
             return true;
         }
         else
         {
             flag = false;
         }
     }
     catch (NotImplementedException notImplementedException)
     {
         Debug.LogException(notImplementedException, this);
         flag = false;
     }
     return flag;
 }
Example #4
0
 public bool PlayAnimation(Facepunch.Movement.GroupEvent GroupEvent)
 {
     return this.PlayAnimation(GroupEvent, 1f, 0f);
 }
Example #5
0
 public bool PlayAnimation(Facepunch.Movement.GroupEvent GroupEvent, float animationSpeed)
 {
     return this.PlayAnimation(GroupEvent, animationSpeed, 0f);
 }
Example #6
0
 public int this[Facepunch.Load.TaskStatus status]
 {
     get
     {
         switch (status)
         {
             case Facepunch.Load.TaskStatus.Pending:
             {
                 return this.Pending;
             }
             case Facepunch.Load.TaskStatus.Downloading:
             {
                 return this.Downloading;
             }
             case Facepunch.Load.TaskStatus.Pending | Facepunch.Load.TaskStatus.Downloading:
             {
                 return this.Pending + this.Downloading;
             }
             case Facepunch.Load.TaskStatus.Complete:
             {
                 return this.Complete;
             }
             case Facepunch.Load.TaskStatus.Pending | Facepunch.Load.TaskStatus.Complete:
             {
                 return this.Pending + this.Complete;
             }
             case Facepunch.Load.TaskStatus.Downloading | Facepunch.Load.TaskStatus.Complete:
             {
                 return this.Pending + this.Downloading;
             }
             case Facepunch.Load.TaskStatus.Pending | Facepunch.Load.TaskStatus.Downloading | Facepunch.Load.TaskStatus.Complete:
             {
                 return this.Pending + this.Downloading + this.Complete;
             }
         }
         return 0;
     }
     set
     {
         int num;
         switch (status)
         {
             case Facepunch.Load.TaskStatus.Pending:
             {
                 this.Pending = value;
                 break;
             }
             case Facepunch.Load.TaskStatus.Downloading:
             {
                 this.Downloading = value;
                 break;
             }
             case Facepunch.Load.TaskStatus.Pending | Facepunch.Load.TaskStatus.Downloading:
             {
                 int num1 = value;
                 num = num1;
                 this.Pending = num1;
                 this.Downloading = num;
                 break;
             }
             case Facepunch.Load.TaskStatus.Complete:
             {
                 this.Complete = value;
                 break;
             }
             case Facepunch.Load.TaskStatus.Pending | Facepunch.Load.TaskStatus.Complete:
             {
                 int num2 = value;
                 num = num2;
                 this.Pending = num2;
                 this.Complete = num;
                 break;
             }
             case Facepunch.Load.TaskStatus.Downloading | Facepunch.Load.TaskStatus.Complete:
             {
                 int num3 = value;
                 num = num3;
                 this.Complete = num3;
                 this.Downloading = num;
                 break;
             }
             case Facepunch.Load.TaskStatus.Pending | Facepunch.Load.TaskStatus.Downloading | Facepunch.Load.TaskStatus.Complete:
             {
                 int num4 = value;
                 num = num4;
                 this.Downloading = num4;
                 int num5 = num;
                 num = num5;
                 this.Pending = num5;
                 this.Complete = num;
                 break;
             }
         }
     }
 }
Example #7
0
 private void InitializeController_OnFoundOverriding(Facepunch.NetworkView driverView)
 {
     Controllable.ControlFlags controlFlag;
     if ((int)(this.F & Controllable.ControlFlags.Root) != 0)
     {
         Controllable controllable = this;
         Controllable.ControlFlags f = controllable.F;
         if (!this.__networkViewForControllable.isMine)
         {
             controlFlag = (Controllable.ControlFlags)0;
         }
         else
         {
             controlFlag = Controllable.ControlFlags.Local;
         }
         controllable.F = f | controlFlag;
         Controllable f1 = this;
         f1.F = f1.F | (!PlayerClient.Find(this.__networkViewForControllable.owner, out this._playerClient) ? Controllable.ControlFlags.Owned : Controllable.ControlFlags.Owned | Controllable.ControlFlags.Player);
     }
     else
     {
         Controllable controllable1 = (driverView.idMain as Character).controllable;
         this.F = this.F & (Controllable.ControlFlags.Root | Controllable.ControlFlags.Strong) | controllable1.F & (Controllable.ControlFlags.Local | Controllable.ControlFlags.Player);
         this._playerClient = controllable1.playerClient;
         controllable1.ch.Add(this);
     }
     Controllable f2 = this;
     f2.F = f2.F | Controllable.ControlFlags.Owned;
     string str = this.controllerClassName;
     if (string.IsNullOrEmpty(str))
     {
         Controllable.ControlFlags controlFlag1 = this.F;
         this.F = (Controllable.ControlFlags)0;
         throw new ArgumentOutOfRangeException("@class", (object)controlFlag1, "The ControllerClass did not support given flags");
     }
     Controller controller = null;
     try
     {
         controller = base.AddAddon<Controller>(str);
         if (!controller)
         {
             throw new ArgumentOutOfRangeException("className", str, "classname as not a Controller!");
         }
         this._controller = controller;
         Controller controller1 = this._controller;
         try
         {
             try
             {
                 this._controller.ControllerSetup(this, this.__networkViewForControllable, ref this.__controllerCreateMessageInfo);
             }
             catch
             {
                 this._controller = controller1;
                 throw;
             }
         }
         catch
         {
             throw;
         }
         Controllable controllable2 = this;
         controllable2.F = controllable2.F | Controllable.ControlFlags.Initialized;
     }
     catch
     {
         if (controller)
         {
             UnityEngine.Object.Destroy(controller);
         }
         this.ch.Delete();
         throw;
     }
 }
Example #8
0
 internal void PrepareInstantiate(Facepunch.NetworkView view, ref uLink.NetworkMessageInfo info)
 {
     PlayerClient playerClient;
     this.__controllerCreateMessageInfo = info;
     this.__networkViewForControllable = view;
     if (this.classFlagsRootControllable || this.classFlagsStandaloneVessel)
     {
         this.__controllerDriverViewID = uLink.NetworkViewID.unassigned;
         if (this.classFlagsStandaloneVessel)
         {
             return;
         }
     }
     else if (this.classFlagsDependantVessel || this.classFlagsFreeVessel)
     {
         if (!PlayerClient.Find(view.owner, out playerClient))
         {
             this.__controllerDriverViewID = uLink.NetworkViewID.unassigned;
         }
         else
         {
             this.__controllerDriverViewID = playerClient.topControllable.networkViewID;
         }
         if (this.classFlagsFreeVessel)
         {
             return;
         }
         if (this.__controllerDriverViewID == uLink.NetworkViewID.unassigned)
         {
             UnityEngine.Debug.LogError("NOT RIGHT");
             return;
         }
     }
     this.FreshInitializeController();
 }
Example #9
0
 public Coroutine Install(Facepunch.Load.Utility.ReferenceCountedCoroutine.Callback callback, object tag, object defaultYieldInstruction, bool skipFirst)
 {
     this.Retain();
     return this.script.StartCoroutine(new Facepunch.Load.Utility.ReferenceCountedCoroutine(this, callback, defaultYieldInstruction, tag, skipFirst));
 }
Example #10
0
 private void JustDecompileGenerated_set_TaskStatus(Facepunch.Load.TaskStatus value)
 {
     this.JustDecompileGenerated_TaskStatus_k__BackingField = value;
 }
 protected ObjectLookupFieldFixedTypeAttribute(PrefabLookupKinds kinds, Type minimalType, Facepunch.Attributes.SearchMode defaultSearchMode, Type[] interfacesRequired)
     : base(kinds, minimalType, defaultSearchMode, interfacesRequired)
 {
 }
Example #12
0
 protected override void StandardInitialization(bool didAppend, IDRemote appended, NetInstance instance, Facepunch.NetworkView view, ref uLink.NetworkMessageInfo info)
 {
     Controllable controllable = ((Character)instance.idMain).controllable;
     controllable.PrepareInstantiate(view, ref info);
     base.StandardInitialization(false, appended, instance, view, ref info);
     if (didAppend)
     {
         NetMainPrefab.IssueLocallyAppended(appended, instance.idMain);
     }
     controllable.OnInstantiated();
 }