public void ReadProperties(INeoDeserializer reader, NeoSerializedGameObject nsgo)
        {
            reader.TryReadValue(k_VelocityKey, out m_Velocity, m_Velocity);
            reader.TryReadValue(k_ReleaseKey, out m_Release, m_Release);
            reader.TryReadValue(k_DistanceKey, out m_Distance, m_Distance);

            int layerMask = m_Layers;

            if (reader.TryReadValue(k_LayersKey, out layerMask, layerMask))
            {
                m_Layers = layerMask;
            }

            Vector3 position;

            if (reader.TryReadValue(k_PositionKey, out position, Vector3.zero))
            {
                m_LerpFromPosition      = position;
                m_LerpToPosition        = position;
                localTransform.position = position;
            }

            IAmmoEffect serializedAmmoEffect;

            if (reader.TryReadComponentReference(k_AmmoEffectKey, out serializedAmmoEffect, nsgo))
            {
                m_AmmoEffect = serializedAmmoEffect;
            }
            IDamageSource serializedDamageSource;

            if (reader.TryReadComponentReference(k_DamageSourceKey, out serializedDamageSource, nsgo))
            {
                m_DamageSource = serializedDamageSource;
            }
        }
Ejemplo n.º 2
0
        public override void ReadProperties(INeoDeserializer reader, NeoSerializedGameObject nsgo)
        {
            base.ReadProperties(reader, nsgo);
            int layers = m_Layers;

            if (reader.TryReadValue(k_LayersKey, out layers, layers))
            {
                collisionLayers = layers;
            }
        }
        public void WriteProperties(INeoSerializer writer, NeoSerializedGameObject nsgo, SaveMode saveMode)
        {
            writer.WriteValue(k_VelocityKey, m_Velocity);
            writer.WriteValue(k_LayersKey, m_Layers);
            writer.WriteValue(k_ReleaseKey, m_Release);
            writer.WriteValue(k_DistanceKey, m_Distance);
            writer.WriteValue(k_PositionKey, m_LerpToPosition);

            writer.WriteComponentReference(k_AmmoEffectKey, m_AmmoEffect, nsgo);
            writer.WriteComponentReference(k_DamageSourceKey, m_DamageSource, nsgo);
        }
Ejemplo n.º 4
0
        public virtual void ReadProperties(INeoDeserializer reader, NeoSerializedGameObject nsgo)
        {
            float floatValue = 0f;

            if (reader.TryReadValue(k_HealthMaxKey, out floatValue, healthMax))
            {
                healthMax = floatValue;
            }
            if (reader.TryReadValue(k_HealthKey, out floatValue, health))
            {
                health = floatValue;
            }

            bool boolValue = true;

            if (reader.TryReadValue(k_IsAliveKey, out boolValue, boolValue))
            {
                isAlive = boolValue;
            }
        }
        protected override void ReadProperties(INeoDeserializer reader, CompassProPOI to, NeoSerializedGameObject nsgo)
        {
            Debug.Log("Loading POI");

            reader.TryReadValue(k_VisitedKey, out to.isVisited, to.isVisited);

            bool heartbeat;

            if (reader.TryReadValue(k_HeartbeatKey, out heartbeat, false))
            {
                if (!to.heartbeatIsActive)
                {
                    to.StartHeartbeat();
                }
            }
        }
        protected override void WriteProperties(INeoSerializer writer, CompassProPOI from, NeoSerializedGameObject nsgo)
        {
            Debug.Log("Saving POI");

            writer.WriteValue(k_VisitedKey, from.isVisited);
            writer.WriteValue(k_HeartbeatKey, from.heartbeatIsActive);
        }
Ejemplo n.º 7
0
        protected override void ReadProperties(INeoDeserializer reader, EmeraldAISystem to, NeoSerializedGameObject nsgo)
        {
            reader.TryReadValue(k_CurrentHealthKey, out to.CurrentHealth, to.CurrentHealth);
            reader.TryReadValue(k_CurrentDamageKey, out to.CurrentDamageAmount, to.CurrentDamageAmount);
            reader.TryReadValue(k_CurrentAggroHitsKey, out to.CurrentAggroHits, to.CurrentAggroHits);
            reader.TryReadValue(k_IsDeadKey, out to.IsDead, to.IsDead);

            reader.TryReadValues(k_ActiveEffectsKey, to.ActiveEffects);

            reader.TryReadTransformReference(k_CurrentTargetKey, out to.CurrentTarget, nsgo);
            reader.TryReadTransformReference(k_CurrentFollowKey, out to.CurrentFollowTarget, nsgo);

            /*
             * Properties to investigate. Current save is very basic
             *
             *
             * if (to.MeleeAttacks.Count > 0)
             * {
             *  reader.TryReadValue("", out to.MeleeAttackIndex, to.MeleeAttackIndex);
             *  reader.TryReadValue("", out to.MeleeAttacksListIndex, to.MeleeAttacksListIndex);
             *  reader.TryReadValue("", out to.CurrentAnimationIndex, to.CurrentAnimationIndex);
             *  reader.TryReadValue("", out to.AttackTimer, to.AttackTimer);
             * }
             *
             * if (to.MeleeRunAttacks.Count > 0)
             * {
             *  reader.TryReadValue("", out to.MeleeRunAttackIndex, to.MeleeRunAttackIndex);
             *  reader.TryReadValue("", out to.MeleeRunAttacksListIndex, to.MeleeRunAttacksListIndex);
             *  reader.TryReadValue("", out to.CurrentRunAttackAnimationIndex, to.CurrentRunAttackAnimationIndex);
             *  reader.TryReadValue("", out to.RunAttackTimer, to.RunAttackTimer);
             *  reader.TryReadValue("", out to.RunAttackSpeed, to.RunAttackSpeed);
             * }
             *
             * if (to.OffensiveAbilities.Count > 0)
             * {
             *  reader.TryReadValue("", out to.OffensiveAbilityIndex, to.OffensiveAbilityIndex);
             * }
             *
             * if (to.SupportAbilities.Count > 0)
             * {
             *  reader.TryReadValue("", out to.SupportAbilityIndex, to.SupportAbilityIndex);
             * }
             *
             * if (to.SummoningAbilities.Count > 0)
             * {
             *  reader.TryReadValue("", out to.SummoningAbilityIndex, to.SummoningAbilityIndex);
             *  reader.TryReadValue("", out to.TotalSummonedAI, to.TotalSummonedAI);
             *
             *  //CurrentSummoner ?? EmeraldAI Ref
             * }
             *
             * reader.TryReadValue("", out to.HealingCooldownTimer, to.HealingCooldownTimer); // Private
             * reader.TryReadValue("", out to.m_AbilityPicked, to.m_AbilityPicked);
             * reader.TryReadValue("", out to.m_InitialTargetPosition, to.m_InitialTargetPosition);
             * reader.TryReadValue("", out to.ObstructionTimer, to.ObstructionTimer);
             * reader.TryReadValue("", out to.m_ObstructedTimer, to.m_ObstructedTimer); // Private
             * reader.TryReadValue("", out to.m_ProjectileCollisionPoint, to.m_ProjectileCollisionPoint);
             *
             * reader.TryReadValue("", out to.ReturnToStationaryPosition, to.ReturnToStationaryPosition);
             * reader.TryReadValue("", out to.SurfaceNormal, to.SurfaceNormal);
             * reader.TryReadValue("", out to.NormalRotation, to.NormalRotation); // Private
             * reader.TryReadValue("", out to.AngleCheckTimer, to.AngleCheckTimer); // Private
             *
             * reader.TryReadValue("", out to.CurrentMovementState, to.CurrentMovementState); // Private
             * reader.TryReadValue("", out to.CurrentBlockingState, to.CurrentBlockingState); // Private
             *
             * reader.TryReadValue("", out to.BackingUpTimer, to.BackingUpTimer);
             * reader.TryReadValue("", out to.BackingUpSeconds, to.BackingUpSeconds);
             * reader.TryReadValue("", out to.BackupDestination, to.BackupDestination);
             *
             * reader.TryReadValue("", out to.Attacking, to.Attacking);
             * reader.TryReadValue("", out to.GettingHit, to.GettingHit);
             *
             * reader.TryReadValue("", out to.m_SwitchingWeaponTypes, to.m_SwitchingWeaponTypes);
             * reader.TryReadValue("", out to.m_WeaponTypeSwitchDelay, to.m_WeaponTypeSwitchDelay); // Private
             *
             * reader.TryReadValue("", out to.AngleToTurn, to.AngleToTurn);
             * reader.TryReadValue("", out to.AlignmentSpeed, to.AlignmentSpeed);
             *
             * reader.TryReadValue("", out to.IdleAnimationTimer, to.IdleAnimationTimer); // Private
             *
             * if (to.IsMoving)
             * {
             *  reader.TryReadValue("", out to.WaypointTimer, to.WaypointTimer);
             *  reader.TryReadValue("", out to.WaypointIndex, to.WaypointIndex);
             *  reader.TryReadValue("", out to.m_LastWaypointIndex, to.m_LastWaypointIndex); // Private
             *
             *  reader.TryReadValue("", out to.NewDestination, to.NewDestination);
             *  reader.TryReadValue("", out to.DistanceFromDestination, to.DistanceFromDestination); // Private
             *  reader.TryReadValue("", out to.TargetDestination, to.TargetDestination);
             *  reader.TryReadValue("", out to.DestinationAdjustedAngle, to.DestinationAdjustedAngle);
             *  reader.TryReadValue("", out to.DestinationDirection, to.DestinationDirection); // Private
             *  reader.TryReadValue("", out to.SingleDestination, to.SingleDestination);
             *
             *  reader.TryReadValue("", out to.Velocity, to.Velocity); // Private
             *  reader.TryReadValue("", out to.AdjustedSpeed, to.AdjustedSpeed); // Private
             *
             *  reader.TryReadValue("", out to.TargetQ, to.TargetQ); // Private
             *  reader.TryReadValue("", out to.GroundQ, to.GroundQ); // Private
             *
             *  reader.TryReadValue("", out to.PreviousAngle, to.PreviousAngle); // Private
             * }
             */
        }
Ejemplo n.º 8
0
        protected override void WriteProperties(INeoSerializer writer, EmeraldAISystem from, NeoSerializedGameObject nsgo)
        {
            writer.WriteValue(k_CurrentHealthKey, from.CurrentHealth);
            writer.WriteValue(k_CurrentDamageKey, from.CurrentDamageAmount);
            writer.WriteValue(k_CurrentAggroHitsKey, from.CurrentAggroHits);
            writer.WriteValue(k_IsDeadKey, from.IsDead);

            if (from.ActiveEffects.Count > 0)
            {
                writer.WriteValues(k_ActiveEffectsKey, from.ActiveEffects);
            }

            writer.WriteTransformReference(k_CurrentTargetKey, from.CurrentTarget, nsgo);
            writer.WriteTransformReference(k_CurrentFollowKey, from.CurrentFollowTarget, nsgo);
        }
Ejemplo n.º 9
0
 public override void WriteProperties(INeoSerializer writer, NeoSerializedGameObject nsgo, SaveMode saveMode)
 {
     base.WriteProperties(writer, nsgo, saveMode);
     writer.WriteValue(k_LayersKey, m_Layers);
 }
 public override void WriteProperties(INeoSerializer writer, NeoSerializedGameObject nsgo, SaveMode saveMode)
 {
     base.WriteProperties(writer, nsgo, saveMode);
 }
 public override void ReadProperties(INeoDeserializer reader, NeoSerializedGameObject nsgo)
 {
     base.ReadProperties(reader, nsgo);
 }
Ejemplo n.º 12
0
 /// INeoSerializableComponent Implenation
 public virtual void WriteProperties(INeoSerializer writer, NeoSerializedGameObject nsgo, SaveMode saveMode)
 {
     writer.WriteValue(k_HealthMaxKey, healthMax);
     writer.WriteValue(k_HealthKey, health);
     writer.WriteValue(k_IsAliveKey, isAlive);
 }
Ejemplo n.º 13
0
 public void ReadProperties(INeoDeserializer reader, NeoSerializedGameObject nsgo)
 {
     reader.TryReadValue(k_PoiIndexKey, out poiNumber, poiNumber);
 }
Ejemplo n.º 14
0
 public void WriteProperties(INeoSerializer writer, NeoSerializedGameObject nsgo, SaveMode saveMode)
 {
     writer.WriteValue(k_PoiIndexKey, poiNumber);
 }
        protected override void ReadProperties(INeoDeserializer reader, CompassPro to, NeoSerializedGameObject nsgo)
        {
            int fogSize;

            if (reader.TryReadValue(k_FogSizeKey, out fogSize, 0))
            {
                Color32[] fogData;
                if (reader.TryReadValues(k_FogDataKey, out fogData, null))
                {
                    to.StartCoroutine(DelayedSetData(to, fogData, fogSize));
                }
            }
        }
 protected override void WriteProperties(INeoSerializer writer, CompassPro from, NeoSerializedGameObject nsgo)
 {
     if (from.fogOfWarEnabled)
     {
         writer.WriteValue(k_FogSizeKey, from.fogOfWarTextureSize);
         writer.WriteValues(k_FogDataKey, from.fogOfWarTextureData);
     }
 }