示例#1
0
 public Asset_Rocket(ModAssetBundle modAssetBundle)
 {
     rocketTrailEffect = modAssetBundle.LoadAsset <GameObject>("RocketTrailEffect");
     //rocketTrailEffect.transform.localScale = MordenFirearmKitBlockMod.Configuration.RocketTrailEffectScale;
     AssetManager.SetObjectScale(rocketTrailEffect, MordenFirearmKitBlockMod.Configuration.GetValue <Vector3>("RocketTrailEffectScale"));
     rocketTemp = CreateRocketBlockTemp();
 }
示例#2
0
        public Asset_Explosion(ModAssetBundle modAssetBundle)
        {
            bigExplosionEffect       = modAssetBundle.LoadAsset <GameObject>("BigExplosion");
            smokeExplosionEffect     = modAssetBundle.LoadAsset <GameObject>("DarkSmoke");
            largeExplosionEffect     = GamePrefabs.InstantiateExplosion(GamePrefabs.ExplosionType.Large);
            smallExplosionEffect     = GamePrefabs.InstantiateExplosion(GamePrefabs.ExplosionType.Small);
            fireworkeExplosionEffect = GamePrefabs.InstantiateExplosion(GamePrefabs.ExplosionType.Firework);

            //AssetManager.SetObjectScale(bigExplosionEffect, MordenFirearmKitBlockMod.Configuration.GetValue<Vector3>("BigExplosionEffectScale"));
            bigExplosionEffect.transform.localScale = Vector3.Scale(bigExplosionEffect.transform.localScale, MordenFirearmKitBlockMod.Configuration.GetValue <Vector3>("BigExplosionEffectScale"));
            bigExplosionEffect.transform.FindChild("Debris").localRotation = Quaternion.AngleAxis(UnityEngine.Random.Range(0f, 360f), Vector3.up);
            bigExplosionEffect.transform.localRotation = Quaternion.AngleAxis(90f, Vector3.left);
            bigExplosionEffect.SetActive(false);

            AssetManager.SetObjectScale(smokeExplosionEffect, MordenFirearmKitBlockMod.Configuration.GetValue <Vector3>("SmokeExplosionEffectScale"));
            smokeExplosionEffect.SetActive(false);

            AssetManager.SetObjectScale(largeExplosionEffect, MordenFirearmKitBlockMod.Configuration.GetValue <Vector3>("LargeExplosionEffectScale"));
            largeExplosionEffect.SetActive(false);

            AssetManager.SetObjectScale(smallExplosionEffect, MordenFirearmKitBlockMod.Configuration.GetValue <Vector3>("SmallExplosionEffectScale"));
            smallExplosionEffect.SetActive(false);

            AssetManager.SetObjectScale(fireworkeExplosionEffect, MordenFirearmKitBlockMod.Configuration.GetValue <Vector3>("FireworkExplosionEffectScale"));
            fireworkeExplosionEffect.SetActive(false);

            bigExplosionEffect.AddComponent <DestroyIfEditMode>();
            smokeExplosionEffect.AddComponent <DestroyIfEditMode>();
        }
示例#3
0
 public static void OnModLoad()
 {
     def = new Color(0.15f, 0.2f, 0.25f);
     FixVacuum();
     bundle                     = ModResource.GetAssetBundle("portal");
     normal                     = ModResource.GetMesh("portalDeviceMesh");
     shooting                   = ModResource.GetMesh("portalDeviceShotMesh");
     bundle.OnLoad             += Load;
     Events.OnSimulationToggle += ResetPortal;
 }
示例#4
0
        private IEnumerator LoadAssetBundle()
        {
            ModAssetBundle modAssetBundle = ModResource.GetAssetBundle("Effect");

            yield return(new WaitUntil(() => modAssetBundle.Available));

            Rocket     = new Asset_Rocket(modAssetBundle);
            Explosion  = new Asset_Explosion(modAssetBundle);
            MachineGun = new Asset_MachineGun(modAssetBundle);
            GatlingGun = new Asset_GatlingGun(modAssetBundle);
            Bullet     = new Asset_Bullet(modAssetBundle);
        }
        protected override void deploySelf()
        {
            ModAssetBundle mab            = ModResource.GetAssetBundle("CitadelAssetBundle");
            GameObject     KeepStarEntity = GameObject.Instantiate((GameObject)mab.LoadAsset <UnityEngine.Object>("assets/keepstar.prefab"));

            KeepStarEntity.name = "KeepstarEntity";

            KeepstarScript ks = KeepStarEntity.AddComponent <KeepstarScript>();

            ks.deploySelf(new Vector3(0.0005f, 0.0005f, 0.0005f), this.transform.position, this.transform.rotation, DictMTContracts);

            this.transform.parent = null;
            Machine.RemoveBlock(Block.From(this));
        }
示例#6
0
        public Asset_Bullet(ModAssetBundle modAssetBundle)
        {
            //impactWoodEffect = modAssetBundle.LoadAsset<GameObject>("BulletImpactWoodEffect");
            //impactStoneEffect = modAssetBundle.LoadAsset<GameObject>("BulletImpactStoneEffect");
            //impactMetalEffect = modAssetBundle.LoadAsset<GameObject>("BulletImpactMetalEffect");
            impactWoodEffect  = AssetManager.LoadAsset <GameObject>("BulletImpactWoodEffect");
            impactStoneEffect = AssetManager.LoadAsset <GameObject>("BulletImpactStoneEffect");
            impactMetalEffect = AssetManager.LoadAsset <GameObject>("BulletImpactMetalEffect");

            //impactWoodEffect.AddComponent<TimedSelfDestruct>().lifeTime = 50f;
            //impactStoneEffect.AddComponent<TimedSelfDestruct>().lifeTime = 50f;
            //impactMetalEffect.AddComponent<TimedSelfDestruct>().lifeTime = 50f;

            AssetManager.SetObjectScale(impactWoodEffect, MordenFirearmKitBlockMod.Configuration.GetValue <Vector3>("ImpactWoodEffectScale"));
            AssetManager.SetObjectScale(impactStoneEffect, MordenFirearmKitBlockMod.Configuration.GetValue <Vector3>("ImpactStoneEffectScale"));
            AssetManager.SetObjectScale(impactMetalEffect, MordenFirearmKitBlockMod.Configuration.GetValue <Vector3>("ImpactMetalEffectScale"));
        }
示例#7
0
        public Asset_GatlingGun(ModAssetBundle modAssetBundle)
        {
            material   = modAssetBundle.LoadAsset <Material>("GatlingGunMat.mat");
            fireEffect = modAssetBundle.LoadAsset <GameObject>("MachineGunFireEffect");

            #region init fire effect
            fireEffect.AddComponent <DestroyIfEditMode>();

            Reactivator fPSDemo = fireEffect.AddComponent <Reactivator>();
            for (int i = 0; i < fireEffect.transform.childCount; i++)
            {
                var go = fireEffect.transform.GetChild(i).gameObject;
                if (go.name == "Point light")
                {
                    FPSLightCurves fPSLight = go.AddComponent <FPSLightCurves>();
                    fPSLight.GraphTimeMultiplier      = 0.15f;
                    fPSLight.GraphIntensityMultiplier = 1;
                    Vector3 vector3 = go.transform.localPosition;
                    vector3.z = -0.5f;
                    go.transform.localPosition = vector3;
                }
                else if (go.name == "MuzzleFlash0")
                {
                    go.AddComponent <FPSRandomRotateAngle>().RotateZ = true;
                    go.transform.localScale = new Vector3(0.6f, 0.6f, 0f);
                }
                else if (go.name == "MuzzleFlash")
                {
                    go.transform.localPosition = new Vector3(0, 0, -0.2f);
                    go.transform.localScale    = new Vector3(0.1f, 0.1f, 0.065f);
                }
                else if (go.name == "Distortion")
                {
                    go.transform.localPosition = new Vector3(0, 0, -0.5f);
                }
            }
            #endregion

            AssetManager.SetObjectScale(fireEffect, MordenFirearmKitBlockMod.Configuration.GetValue <Vector3>("GatlingFireEffectScale"));

            bulletTemp = CreateBulletTemp();
        }