Ejemplo n.º 1
0
 public Initialization(CCTotemPole totemPole, CCDesc figurePrefab, float minHeight, float maxHeight, float initialHeight, float bottomBufferUnits)
 {
     this.totemPole         = totemPole;
     this.figurePrefab      = figurePrefab;
     this.minHeight         = minHeight;
     this.maxHeight         = maxHeight;
     this.initialHeight     = initialHeight;
     this.bottomBufferUnits = bottomBufferUnits;
     this.nonDefault        = true;
 }
Ejemplo n.º 2
0
 private static void DestroyCCDesc(CCTotemPole ScriptOwner, ref CCDesc CCDesc)
 {
     if (!ScriptOwner)
     {
         CCDesc cCDesc = CCDesc;
         CCDesc = null;
         if (cCDesc)
         {
             UnityEngine.Object.Destroy(cCDesc.gameObject);
         }
     }
     else
     {
         ScriptOwner.DestroyCCDesc(ref CCDesc);
     }
 }
Ejemplo n.º 3
0
        internal void Delete(CCTotemPole OwnerScript)
        {
            CCTotemicFigure script = this.Script;

            this.Script = null;
            if (script && object.ReferenceEquals(script.totemicObject, this))
            {
                script.totemicObject = null;
            }
            CCTotem.DestroyCCDesc(OwnerScript, ref this.CCDesc);
            if (script)
            {
                UnityEngine.Object.Destroy(script.gameObject);
            }
            if (object.ReferenceEquals(this.TotemPole.TotemicFigures[this.BottomUpIndex], this))
            {
                this.TotemPole.TotemicFigures[this.BottomUpIndex] = null;
            }
        }
Ejemplo n.º 4
0
 private new void OnDestroy()
 {
     try
     {
         base.OnDestroy();
     }
     finally
     {
         if (this._installed)
         {
             CCMotor.Callbacks.UninstallCallbacks(this, this.cc);
         }
         this.cc = null;
     }
 }
Ejemplo n.º 5
0
 public void InitializeSetup(Character character, CCTotemPole cc, CharacterCCMotorTrait trait)
 {
     this.tr = base.transform;
     this.cc = cc;
     base.idMain = character;
     CCMotor.YawAngle yawAngle = 0f;
     CCMotor.YawAngle yawAngle1 = yawAngle;
     this.previousYaw = yawAngle;
     this.currentYaw = yawAngle1;
     if (trait)
     {
         if (trait.settings)
         {
             this.settings = trait.settings;
         }
         this.canControl = trait.canControl;
         this.sendLandMessage = trait.sendLandMessage;
         this.sendJumpMessage = trait.sendJumpMessage;
         this.sendJumpFailureMessage = trait.sendJumpFailureMessage;
         this.sendFallMessage = trait.sendFallMessage;
         this.sendExternalVelocityMessage = trait.sendExternalVelocityMessage;
         this.stepMode = trait.stepMode;
         this.minTimeBetweenJumps = trait.minTimeBetweenJumps;
     }
     if (!this._installed && cc)
     {
         this._installed = true;
         CCMotor.Callbacks.InstallCallbacks(this, cc);
     }
 }
Ejemplo n.º 6
0
 public static void UninstallCallbacks(CCMotor CCMotor, CCTotemPole CCTotemPole)
 {
     if (CCTotemPole && object.ReferenceEquals(CCTotemPole.Tag, CCMotor))
     {
         CCTotemPole.OnConfigurationBinding -= CCMotor.Callbacks.ConfigurationBinder;
         CCTotemPole.OnBindPosition -= CCMotor.Callbacks.PositionBinder;
         CCTotemPole.Tag = null;
     }
 }
Ejemplo n.º 7
0
 public static void InstallCallbacks(CCMotor CCMotor, CCTotemPole CCTotemPole)
 {
     CCTotemPole.Tag = CCMotor;
     CCTotemPole.OnBindPosition += CCMotor.Callbacks.PositionBinder;
     CCTotemPole.OnConfigurationBinding += CCMotor.Callbacks.ConfigurationBinder;
 }