コード例 #1
0
        public override YAMLNode ExportYAML(IExportContainer container)
        {
#warning TODO: values acording to read version (current 2017.3.0f3)
            YAMLMappingNode node = (YAMLMappingNode)base.ExportYAML(container);
            node.AddSerializedVersion(GetSerializedVersion(container.Version));
            node.Add("type", (int)Type);
            node.Add("collisionMode", (int)CollisionMode);
            node.Add("colliderForce", ColliderForce);
            node.Add("multiplyColliderForceByParticleSize", MultiplyColliderForceByParticleSize);
            node.Add("multiplyColliderForceByParticleSpeed", MultiplyColliderForceByParticleSpeed);
            node.Add("multiplyColliderForceByCollisionAngle", GetExportMultiplyColliderForceByCollisionAngle(container.Version));
            node.Add("plane0", Plane0.ExportYAML(container));
            node.Add("plane1", Plane1.ExportYAML(container));
            node.Add("plane2", Plane2.ExportYAML(container));
            node.Add("plane3", Plane3.ExportYAML(container));
            node.Add("plane4", Plane4.ExportYAML(container));
            node.Add("plane5", Plane5.ExportYAML(container));
            node.Add("m_Dampen", Dampen.ExportYAML(container));
            node.Add("m_Bounce", Bounce.ExportYAML(container));
            node.Add("m_EnergyLossOnCollision", EnergyLossOnCollision.ExportYAML(container));
            node.Add("minKillSpeed", MinKillSpeed);
            node.Add("maxKillSpeed", GetExportMaxKillSpeed(container.Version));
            node.Add("radiusScale", GetExportRadiusScale(container.Version));
            node.Add("collidesWith", GetExportCollidesWith(container.Version).ExportYAML(container));
            node.Add("maxCollisionShapes", GetExportMaxCollisionShapes(container.Version));
            node.Add("quality", (int)Quality);
            node.Add("voxelSize", GetExportVoxelSize(container.Version));
            node.Add("collisionMessages", CollisionMessages);
            node.Add("collidesWithDynamic", GetExportCollidesWithDynamic(container.Version));
            node.Add("interiorCollisions", InteriorCollisions);
            return(node);
        }
コード例 #2
0
        public override YAMLNode ExportYAML(IExportContainer container)
        {
            YAMLMappingNode node = (YAMLMappingNode)base.ExportYAML(container);

            node.AddSerializedVersion(ToSerializedVersion(container.ExportVersion));
            node.Add(TypeName, (int)Type);
            node.Add(CollisionModeName, (int)CollisionMode);
            node.Add(ColliderForceName, ColliderForce);
            node.Add(MultiplyColliderForceByParticleSizeName, MultiplyColliderForceByParticleSize);
            node.Add(MultiplyColliderForceByParticleSpeedName, MultiplyColliderForceByParticleSpeed);
            node.Add(MultiplyColliderForceByCollisionAngleName, GetExportMultiplyColliderForceByCollisionAngle(container.Version));
            node.Add(Plane0Name, Plane0.ExportYAML(container));
            node.Add(Plane1Name, Plane1.ExportYAML(container));
            node.Add(Plane2Name, Plane2.ExportYAML(container));
            node.Add(Plane3Name, Plane3.ExportYAML(container));
            node.Add(Plane4Name, Plane4.ExportYAML(container));
            node.Add(Plane5Name, Plane5.ExportYAML(container));
            node.Add(DampenName, Dampen.ExportYAML(container));
            node.Add(BounceName, Bounce.ExportYAML(container));
            node.Add(EnergyLossOnCollisionName, EnergyLossOnCollision.ExportYAML(container));
            node.Add(MinKillSpeedName, MinKillSpeed);
            node.Add(MaxKillSpeedName, GetExportMaxKillSpeed(container.Version));
            node.Add(RadiusScaleName, GetExportRadiusScale(container.Version));
            node.Add(CollidesWithName, GetExportCollidesWith(container.Version).ExportYAML(container));
            node.Add(MaxCollisionShapesName, GetExportMaxCollisionShapes(container.Version));
            node.Add(QualityName, (int)Quality);
            node.Add(VoxelSizeName, GetExportVoxelSize(container.Version));
            node.Add(CollisionMessagesName, CollisionMessages);
            node.Add(CollidesWithDynamicName, GetExportCollidesWithDynamic(container.Version));
            node.Add(InteriorCollisionsName, InteriorCollisions);
            return(node);
        }
コード例 #3
0
        public bool IsBetweenOrOn(Vector3D point)
        {
            var side1         = Plane1.GetSide(point);
            var side2         = Plane2.GetSide(point);
            var isBetweenOrOn = side1 == 0 || side2 == 0 || side1 != side2;

            return(isBetweenOrOn);
        }
コード例 #4
0
    void OnEndRoundClick()
    {
        scores = new List <ScoreContext>();
        foreach (GameObject obj in GameObject.FindGameObjectsWithTag("Plane"))
        {
            Plane1 plane = obj.GetComponent <Plane1>();
            scores.Add(new ScoreContext(plane.id, plane.famePoints, plane.color));
        }

        SceneManager.LoadScene("RoundOver", LoadSceneMode.Single);
        pause = false;
    }
コード例 #5
0
ファイル: Plane1.cs プロジェクト: UNFDanmark/GDC2017-GR7
 public void UpdateTargetingMe()
 {
     planesTargettingMe = new List <GameObject>();
     foreach (GameObject obj in GetOtherPlanes())
     {
         Plane1 script = obj.GetComponent <Plane1>();
         if (script.targetPlane == gameObject)
         {
             planesTargettingMe.Add(obj.gameObject);
         }
     }
 }
コード例 #6
0
        public IEnumerable <Object> FetchDependencies(ISerializedFile file, bool isLog = false)
        {
            yield return(Plane0.FetchDependency(file, isLog, () => nameof(CollisionModule), "m_Plane0"));

            yield return(Plane1.FetchDependency(file, isLog, () => nameof(CollisionModule), "m_Plane1"));

            yield return(Plane2.FetchDependency(file, isLog, () => nameof(CollisionModule), "m_Plane2"));

            yield return(Plane3.FetchDependency(file, isLog, () => nameof(CollisionModule), "m_Plane3"));

            yield return(Plane4.FetchDependency(file, isLog, () => nameof(CollisionModule), "m_Plane4"));

            yield return(Plane5.FetchDependency(file, isLog, () => nameof(CollisionModule), "m_Plane5"));
        }
コード例 #7
0
ファイル: Plane1.cs プロジェクト: UNFDanmark/GDC2017-GR7
    void OnTriggerEnter(Collider other)
    {
        if (respawnProtection >= 0)
        {
            return;
        }

        if (other.gameObject.name.StartsWith("Bullet") &&
            other.gameObject.GetComponent <BulletScript>().mainPlane != this.gameObject)
        {
            Plane1 script = other.gameObject.GetComponent <BulletScript>().mainPlane.GetComponent <Plane1>();
            print(script.targetPlane.name + gameObject.name);
            if (GameController.gamemode == GameController.MODE_TARGETS &&
                script.targetPlane != gameObject)
            {
                return;
            }

            script.famePoints += 100;
            Destroy(other.gameObject);
            soundScript.TauntsFunction(script.id);

            if (alive)
            {
                Death();
                RandomTarget();
                script.RandomTarget();
            }
        }
        else if (other.gameObject.name.StartsWith("Plane"))
        {
            Death();
            famePoints -= 25;
            soundScript.ExplosionFunction();
        }
    }
コード例 #8
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            Type = (ParticleSystemCollisionType)reader.ReadInt32();
            if (IsReadCollisionMode(reader.Version))
            {
                CollisionMode = (ParticleSystemCollisionMode)reader.ReadInt32();
            }
            if (IsReadColliderForce(reader.Version))
            {
                ColliderForce = reader.ReadSingle();
                MultiplyColliderForceByParticleSize   = reader.ReadBoolean();
                MultiplyColliderForceByParticleSpeed  = reader.ReadBoolean();
                MultiplyColliderForceByCollisionAngle = reader.ReadBoolean();
                reader.AlignStream(AlignType.Align4);
            }

            Plane0.Read(reader);
            Plane1.Read(reader);
            Plane2.Read(reader);
            Plane3.Read(reader);
            Plane4.Read(reader);
            Plane5.Read(reader);

            if (IsReadDampenSingle(reader.Version))
            {
                float dampenSingle = reader.ReadSingle();
                float bounceSingle = reader.ReadSingle();
                float energyLossOnCollisionSingle = reader.ReadSingle();
                Dampen = new MinMaxCurve(dampenSingle);
                Bounce = new MinMaxCurve(bounceSingle);
                EnergyLossOnCollision = new MinMaxCurve(energyLossOnCollisionSingle);
            }
            else
            {
                Dampen.Read(reader);
                Bounce.Read(reader);
                EnergyLossOnCollision.Read(reader);
            }

            MinKillSpeed = reader.ReadSingle();
            if (IsReadMaxKillSpeed(reader.Version))
            {
                MaxKillSpeed = reader.ReadSingle();
            }
            if (IsReadRadiusScale(reader.Version))
            {
                RadiusScale = reader.ReadSingle();
                CollidesWith.Read(reader);
            }
            if (IsReadMaxCollisionShapes(reader.Version))
            {
                MaxCollisionShapes = reader.ReadInt32();
            }
            if (IsReadQuality(reader.Version))
            {
                Quality   = (ParticleSystemCollisionQuality)reader.ReadInt32();
                VoxelSize = reader.ReadSingle();
            }
            if (IsReadCollisionMessages(reader.Version))
            {
                CollisionMessages = reader.ReadBoolean();
            }
            if (IsReadCollidesWithDynamic(reader.Version))
            {
                CollidesWithDynamic = reader.ReadBoolean();
                InteriorCollisions  = reader.ReadBoolean();
                reader.AlignStream(AlignType.Align4);
            }
        }
コード例 #9
0
        public override void Read(AssetStream stream)
        {
            base.Read(stream);

            Type = stream.ReadInt32();
            if (IsReadCollisionMode(stream.Version))
            {
                CollisionMode = stream.ReadInt32();
            }
            if (IsReadColliderForce(stream.Version))
            {
                ColliderForce = stream.ReadSingle();
                MultiplyColliderForceByParticleSize   = stream.ReadBoolean();
                MultiplyColliderForceByParticleSpeed  = stream.ReadBoolean();
                MultiplyColliderForceByCollisionAngle = stream.ReadBoolean();
                stream.AlignStream(AlignType.Align4);
            }

            Plane0.Read(stream);
            Plane1.Read(stream);
            Plane2.Read(stream);
            Plane3.Read(stream);
            Plane4.Read(stream);
            Plane5.Read(stream);

            if (IsReadDampenSingle(stream.Version))
            {
                DampenSingle = stream.ReadSingle();
                BounceSingle = stream.ReadSingle();
                EnergyLossOnCollisionSingle = stream.ReadSingle();
            }
            else
            {
                Dampen.Read(stream);
                Bounce.Read(stream);
                EnergyLossOnCollision.Read(stream);
            }

            MinKillSpeed = stream.ReadSingle();
            if (IsReadMaxKillSpeed(stream.Version))
            {
                MaxKillSpeed = stream.ReadSingle();
            }
            if (IsReadRadiusScale(stream.Version))
            {
                RadiusScale = stream.ReadSingle();
                CollidesWith.Read(stream);
            }
            if (IsReadMaxCollisionShapes(stream.Version))
            {
                MaxCollisionShapes = stream.ReadInt32();
            }
            if (IsReadQuality(stream.Version))
            {
                Quality   = stream.ReadInt32();
                VoxelSize = stream.ReadSingle();
            }
            if (IsReadCollisionMessages(stream.Version))
            {
                CollisionMessages = stream.ReadBoolean();
            }
            if (IsReadCollidesWithDynamic(stream.Version))
            {
                CollidesWithDynamic = stream.ReadBoolean();
                InteriorCollisions  = stream.ReadBoolean();
                stream.AlignStream(AlignType.Align4);
            }
        }