Ejemplo n.º 1
0
        public SerializedEntity Copy()
        {
            SerializedEntity c = new SerializedEntity();

            c.typeName         = typeName;
            c.value            = value;
            c.isTargetable     = isTargetable;
            c.minDamage        = minDamage;
            c.maxDamage        = maxDamage;
            c.detonateDistance = detonateDistance;
            c.detonateEffect   = detonateEffect;
            c.damageRadius     = damageRadius;
            c.homing           = homing;
            c.autoRotate       = autoRotate;
            c.maxDistance      = maxDistance;
            c.health           = health;
            c.deathSound       = deathSound;
            c.isWeapon         = isWeapon;
            c.deathTexts       = deathTexts;
            c.birthTexts       = birthTexts;
//            Debug.Log(c.typeName + " " + birthTexts.Count);
            c.body = body.Copy();



            return(c);
        }
Ejemplo n.º 2
0
 public void Initialize(SerializedEntity se, Vector3 pos, Teams t, Vector3 dir)
 {
     serializedEntity = se.Copy();//Util.DeepClone<SerializedEntity>(se);
     body             = new EntityBodyPart(transform, serializedEntity.body, true);
     team             = t;
     particle.P       = pos;
     particle.V       = dir;
 }
Ejemplo n.º 3
0
        public static void Generate()
        {
            SerializedEntities test = new SerializedEntities();
            SerializedEntity   sen  = new SerializedEntity();
            SerializedBodyPart bp   = new SerializedBodyPart();

            bp.bodyParts.Add(new SerializedBodyPart());
            sen.body = bp;
            test.entities.Add(sen);
            Serialize(test, Constants.EntitiesXML);
        }
Ejemplo n.º 4
0
        public void InitializePrefab(SerializedEntity se, Vector3 pos, Teams t, Vector3 dir)
        {
            serializedEntity = se.Copy();//Util.DeepClone<SerializedEntity>(se);
            //serializedEntity = e.serializedEntity.Copy();

            body       = new EntityBodyPart(transform, serializedEntity.body);
            team       = t;
            particle.P = pos;
            particle.V = dir;

            if (Random.value < GameSettings.birthMessageProbability && serializedEntity.birthTexts.Count > 0)
            {
                GameFightLevel.messages.Add(serializedEntity.birthTexts[Random.Range(0, serializedEntity.birthTexts.Count)], Messages.MessageType.Good, pos);
            }
        }