Beispiel #1
0
        public override void OnInitialize()
        {
            base.OnInitialize();

            NativeEntity.LoadGeometry(0, "objects/default/primitive_sphere.cgf");
            Scale                        = Vec3.One * 0.5f;
            collisionListener            = AddComponent <CollisionListener>();
            collisionListener.OnCollide += OnCollide;
        }
Beispiel #2
0
 public void SetUnitData(UnitData unitData)
 {
     UnitData = unitData;
     Health.SetMaxHealth(unitData.MaxHealth);
     Health.SetHealth(unitData.MaxHealth);
     NativeEntity.LoadGeometry(0, unitData.Mesh);
     NativeEntity.SetMaterial(unitData.Material);
     OnSetUnitData(unitData);
 }
Beispiel #3
0
//        GameObject core;

        public override void OnInitialize()
        {
            base.OnInitialize();

            Health = new Health();
            NativeEntity.LoadGeometry(0, AssetLibrary.Meshes.BasePlate);
            NativeEntity.SetMaterial(AssetLibrary.Materials.BasePlate);

            NativeEntity.LoadGeometry(1, AssetLibrary.Meshes.Diamond);
            NativeEntity.SetSlotMaterial(1, AssetLibrary.Materials.BaseCore);
            NativeEntity.SetSlotLocalTM(1, Matrix34.Create(Vec3.One, Quat.Identity, new Vec3(0, 0, 2f)));
        }
Beispiel #4
0
        public override void OnInitialize()
        {
            base.OnInitialize();

            // Load default geometry.
            NativeEntity.LoadGeometry(0, "objects/default/primitive_sphere.cgf");

            // Load default material.
            NativeEntity.SetMaterial("materials/matref_chrome128.mtl");

            // Physicalize.
            Physics.Physicalize(10, EPhysicalizationType.ePT_Rigid);
        }
        public override void OnInitialize()
        {
            base.OnInitialize();

            collisionListener            = AddComponent <CollisionListener>();
            collisionListener.OnCollide += CollisionListener_OnCollide;

            NativeEntity.LoadGeometry(0, "objects/default/primitive_sphere.cgf");

            var physParams = new SEntityPhysicalizeParams()
            {
                density = 1,
                mass    = 10,
                type    = (int)EPhysicalizationType.ePT_Rigid,
            };

            NativeEntity.Physicalize(physParams);
        }
Beispiel #6
0
        public override void OnInitialize()
        {
            var physParams = new SEntityPhysicalizeParams()
            {
                mass    = -1,
                density = -1,
                type    = (int)EPhysicalizationType.ePT_Rigid,
            };

            // Create the mesh that responds to mouse interaction
            NativeEntity.LoadGeometry(slotInteractionPlate, AssetLibrary.Meshes.Hexagon);
            NativeEntity.SetSlotMaterial(slotInteractionPlate, AssetLibrary.Materials.GreyMin);

            // Create the BasePlate that represents the Construction Point.
            NativeEntity.LoadGeometry(slotBasePlate, AssetLibrary.Meshes.BasePlate);
            NativeEntity.SetSlotMaterial(slotBasePlate, AssetLibrary.Materials.BasePlate);

            NativeEntity.Physicalize(physParams);
        }