Exemplo n.º 1
0
        private static void CreateEarthPowerWave()
        {
            earthPowerWave = CloneProjectilePrefab("BrotherUltLineProjectileRotateLeft", "EarthPowerProjectile");

            earthPowerWave.GetComponent <ProjectileDamage>().damageType = DamageType.IgniteOnHit;

            RegigigasPlugin.DestroyImmediate(earthPowerWave.GetComponent <RotateAroundAxis>());

            GameObject waveGhost = PrefabAPI.InstantiateClone(Resources.Load <GameObject>("Prefabs/ProjectileGhosts/BrotherUltLineGhost"), "EarthPowerProjectileGhost", true);

            if (!waveGhost.GetComponent <NetworkIdentity>())
            {
                waveGhost.AddComponent <NetworkIdentity>();
            }

            // gather materials and stuff
            PostProcessProfile magmaWormPP                  = Resources.Load <GameObject>("Prefabs/CharacterBodies/MagmaWormBody").GetComponentInChildren <PostProcessVolume>().sharedProfile;
            Material           matMagmaOpaqueLarge          = Resources.Load <GameObject>("Prefabs/ProjectileGhosts/MagmaOrbGhost").transform.Find("Particles").Find("SpitCore").GetComponent <ParticleSystemRenderer>().material;
            Material           matMagmaOpaqueDirectional    = Resources.Load <GameObject>("Prefabs/Effects/MagmaWormBurrow").transform.Find("ParticleLoop").Find("Magma, Directional").GetComponent <ParticleSystemRenderer>().material;
            Material           titanPredictionEffect        = Resources.Load <GameObject>("Prefabs/Projectiles/TitanPreFistProjectile").transform.Find("TeamAreaIndicator, GroundOnly").GetComponent <TeamAreaIndicator>().teamMaterialPairs[0].sharedMaterial;
            Material           matSpiteBombPredictionEffect = Resources.Load <GameObject>("Prefabs/Effects/SpiteBombDelayEffect").transform.Find("Nova Sphere").GetComponent <ParticleSystemRenderer>().material;

            waveGhost.transform.Find("Size").Find("IndicatorFX").GetComponent <MeshRenderer>().material = titanPredictionEffect;
            waveGhost.transform.Find("Size").Find("IndicatorFX").Find("Edges").GetComponent <MeshRenderer>().material = matSpiteBombPredictionEffect;
            waveGhost.transform.Find("Size").Find("FireFX").Find("Dust, Directional").GetComponent <ParticleSystemRenderer>().material = matMagmaOpaqueDirectional;
            waveGhost.transform.Find("Size").Find("FireFX").Find("SparksUp").GetComponent <ParticleSystemRenderer>().material          = matMagmaOpaqueLarge;

            waveGhost.transform.Find("Size").Find("FireFX").GetComponent <PostProcessVolume>().sharedProfile = magmaWormPP;

            earthPowerWave.GetComponent <ProjectileController>().ghostPrefab = waveGhost;
        }
Exemplo n.º 2
0
        private static GameObject CreateModel(GameObject main, string modelName)
        {
            RegigigasPlugin.DestroyImmediate(main.transform.Find("ModelBase").gameObject);
            RegigigasPlugin.DestroyImmediate(main.transform.Find("CameraPivot").gameObject);
            RegigigasPlugin.DestroyImmediate(main.transform.Find("AimOrigin").gameObject);

            if (Modules.Assets.mainAssetBundle.LoadAsset <GameObject>(modelName) == null)
            {
                Debug.LogError("Trying to load a null model- check to see if the name in your code matches the name of the object in Unity");
                return(null);
            }

            return(GameObject.Instantiate(Modules.Assets.mainAssetBundle.LoadAsset <GameObject>(modelName)));
        }
Exemplo n.º 3
0
        internal static void CreateSkillFamilies(GameObject targetPrefab)
        {
            foreach (GenericSkill obj in targetPrefab.GetComponentsInChildren <GenericSkill>())
            {
                RegigigasPlugin.DestroyImmediate(obj);
            }

            SkillLocator skillLocator = targetPrefab.GetComponent <SkillLocator>();

            skillLocator.primary = targetPrefab.AddComponent <GenericSkill>();
            SkillFamily primaryFamily = ScriptableObject.CreateInstance <SkillFamily>();

            primaryFamily.variants            = new SkillFamily.Variant[0];
            skillLocator.primary._skillFamily = primaryFamily;
            AddSkillFamily(primaryFamily);

            skillLocator.secondary = targetPrefab.AddComponent <GenericSkill>();
            SkillFamily secondaryFamily = ScriptableObject.CreateInstance <SkillFamily>();

            secondaryFamily.variants            = new SkillFamily.Variant[0];
            skillLocator.secondary._skillFamily = secondaryFamily;
            AddSkillFamily(secondaryFamily);

            skillLocator.utility = targetPrefab.AddComponent <GenericSkill>();
            SkillFamily utilityFamily = ScriptableObject.CreateInstance <SkillFamily>();

            utilityFamily.variants            = new SkillFamily.Variant[0];
            skillLocator.utility._skillFamily = utilityFamily;
            AddSkillFamily(utilityFamily);

            skillLocator.special = targetPrefab.AddComponent <GenericSkill>();
            SkillFamily specialFamily = ScriptableObject.CreateInstance <SkillFamily>();

            specialFamily.variants            = new SkillFamily.Variant[0];
            skillLocator.special._skillFamily = specialFamily;
            AddSkillFamily(specialFamily);
        }