void Start()
    {
        Pooler.Instantiate(exp, exp_prefab, 100);
        Pooler.Instantiate(redLaser, redLaser_prefab, laserCount);

        //DebugText.Instance.SetText("" + laserCount);
    }
Exemple #2
0
    //int shootParticleCount;


    protected override void Start()
    {
        // Power Shot
        skillCost[0] = 400;
        skillMax[0]  = skillCost[0];

        // Nova
        skillCost[1] = 2000;
        skillMax[1]  = skillCost[1];

        shootPower[0] = 1900;
        shootPower[1] = shootPower[0];
        shootPower[2] = shootPower[0];

        shootDelay[0] = 0.135f;
        shootDelay[1] = shootDelay[0];
        shootDelay[2] = shootDelay[0];

        Pooler.Instantiate(laser1, laser1_prefab, 15);
        Pooler.Instantiate(laser2, laser2_prefab, 30);
        //Pooler.Instantiate(laserBlast, laserBlast_prefab, 12);

        powerShot = Instantiate(powerShot_prefab).GetComponent <PowerShot>();
        powerShot.gameObject.SetActive(false);
        powerShot.owner = this;

        nova = Instantiate(nova_prefab).GetComponent <StunNova>();
        nova.gameObject.SetActive(false);
        nova.owner = this;



        base.Start();
    }
    protected override void Start()
    {
        // Aimed Blast
        skillCost[0] = 800;
        skillMax[0]  = skillCost[0];

        // Chrono
        skillCost[1] = 1000;
        skillMax[1]  = skillCost[1];

        shootPower[0] = 700;
        shootPower[1] = 750;
        shootPower[2] = 850;

        shootDelay[0] = 0.03f;
        shootDelay[1] = 0.025f;
        shootDelay[2] = 0.02f;

        Pooler.Instantiate(bubble, bubble_prefab, 40);



        shootPoint = transform.Find("Shoot Point").gameObject;

        base.Start();
    }
    protected override void Start()
    {
        // Laser
        skillCost[0] = 3200;
        skillMax[0]  = skillCost[0];

        // Switch
        skillCost[1] = 1200;
        skillMax[1]  = skillCost[1];

        shootPower[0] = shootPowerMod[attackMode - 1, 0];
        shootPower[1] = shootPowerMod[attackMode - 1, 1];
        shootPower[2] = shootPowerMod[attackMode - 1, 2];

        shootDelay[0] = shootDelayMod[attackMode - 1, 0];
        shootDelay[1] = shootDelayMod[attackMode - 1, 1];
        shootDelay[2] = shootDelayMod[attackMode - 1, 2];

        Pooler.Instantiate(laser1, laser_prefab[0], 20);
        Pooler.Instantiate(laser2, laser_prefab[1], 50);
        Pooler.Instantiate(laser3, laser_prefab[2], 200);

        angleDelay = 180;

        nova = Instantiate(nova_prefab);
        nova.gameObject.SetActive(false);
        nova.GetComponent <Nova>().FollowOwner(this.transform);



        base.Start();
    }
Exemple #5
0
    protected override void Start()
    {
        // Bomb
        skillCost[0] = 300;
        skillMax[0]  = skillCost[0] * 5;

        skillCost[1] = 200;
        skillMax[1]  = skillCost[1];

        //// Detonate
        //skillCD[1] = 0;

        shootPower[0] = 900;
        shootPower[1] = 1000;
        shootPower[2] = 1100;

        shootDelay[0] = 0.5f;
        shootDelay[1] = shootDelay[0];
        shootDelay[2] = shootDelay[0];

        shootPoint = transform.Find("Shoot Point").gameObject;

        Pooler.Instantiate(laser, laser_prefab, 150);
        Pooler.Instantiate(bomb, bomb_prefab, 20);

        nova = Instantiate(nova_prefab);
        nova.gameObject.SetActive(false);

        for (int i = 0; i < 4; i++)
        {
            part[i].transform.localPosition = part[i].transform.localPosition.normalized * defaultSize;
        }

        base.Start();
    }
Exemple #6
0
        public NetworkIdentity CreateDynamicNetworkIdentity(string resourceName, long networkId, long ownerId, Vector3 position, Quaternion rotation)
        {
            if (ResourcePrefabCache.TryGetValue(resourceName, out NetworkIdentity networkIdentityPrefab) == false)
            {
                networkIdentityPrefab = Resources.Load <NetworkIdentity>(resourceName);
                ResourcePrefabCache.Add(resourceName, networkIdentityPrefab);
            }

            var newNetworkIdentity = Pooler.Instantiate(networkIdentityPrefab);

            newNetworkIdentity.SetClient(this.gameClient);
            newNetworkIdentity.SetNetworkId(networkId);
            newNetworkIdentity.SetOwner(ownerId, newNetworkIdentity.CanChangeOwner);
            newNetworkIdentity.ResourceName = resourceName;
            newNetworkIdentity.transform.SetPositionAndRotation(position, rotation);

            if (this.isConnected)
            {
                newNetworkIdentity.RequestUpdate();
            }

            // Registering the new dynamic object
            this.dynamicNetworkObjectsHash.Add(newNetworkIdentity.NetworkId, newNetworkIdentity);
            this.dynamicNetworkObjectsList.Add(newNetworkIdentity);

            return(newNetworkIdentity);
        }
    protected override void Start()
    {
        // Black Hole
        skillCost[0] = 800;
        skillMax[0]  = skillCost[0];

        // Super Nova
        skillCost[1] = 1400;
        skillMax[1]  = skillCost[1];

        shootPower[0] = 1500;
        shootPower[1] = shootPower[0] + 50;
        shootPower[2] = shootPower[0] + 100;

        shootDelay[0] = 0.1f;
        shootDelay[1] = 0.08f;
        shootDelay[2] = 0.05f;

        shootPoint = transform.Find("Shoot Point").gameObject;

        Pooler.Instantiate(laser, laser_prefab, 42);
        Pooler.Instantiate(blackHole, blackHole_prefab, 8);

        base.Start();
    }
    protected override void Start()
    {
        Pooler.Instantiate(nova, nova_prefab, 10);
        //core = GameObject.FindWithTag("Core").transform;
        //speed = 100;

        for (int i = 0; i < 4; i++)
        {
            line[i] = part[i].GetComponent <LineRenderer>();
            //col[i] = laser[i].GetComponent<BoxCollider>();
        }

        rotationSpeed = 5;
        //targetLength = 250;

        base.Start();
    }
Exemple #9
0
    override protected void Start()
    {
        stunImmune = true;
        timeImmune = true;


        LM = BaseLevel.Instance;

        drone = Resources.Load("Prefabs/Enemies/MiniDrone") as GameObject;

        //Camera.main.GetComponent<CameraControl>().AddTarget(camPoint);

        Pooler.Instantiate(blast, blast_prefab, 150);
        //LM.StartAt(190);
        //beatNum = 190;

        base.Start();
    }
Exemple #10
0
    protected virtual void Awake()
    {
        //solarCore = Object.FindObjectOfType<SolarCore>().gameObject;
        sRings = Object.FindObjectOfType <SolarRings>();

        background = Camera.main.GetComponent <BackgroundControl>();

        coin_prefab = Resources.Load("Prefabs/Coin") as GameObject;
        Pooler.Instantiate(coin, coin_prefab, 50);

        music = Music.Instance.GetComponent <AudioSource>();



        if (HardMode.active)
        {
            music.pitch *= 1.1f;
            syncOverride = true;
        }
    }
Exemple #11
0
        /// <summary>
        /// Uses the the plant parameters to generates a new plant.
        /// </summary>
        private void Generate()
        {
            // making sure it hasn't already been generated
            if (this.IsGenerated)
            {
                return;
            }

            // making sure layerId gets initialized
            if (layerId == -1)
            {
                layerId = LayerMask.NameToLayer(LayerName);

                if (layerId == -1)
                {
                    string message = string.Format("PlantGenerator couldn't find layer \"{0}\".  To stop the plants from jiggling, go to the menu \"Edit -> Project Settings -> Tags and Layers\" and make sure the layer \"{0}\" exists.", LayerName);
                    Debug.LogError(message, this.gameObject);
                }
                else
                {
                    Physics.IgnoreLayerCollision(layerId, layerId);
                }
            }

            System.Random          rand = new System.Random(this.Seed);
            SuitableRotationSystem suitableRotationSystem = new SuitableRotationSystem(rand);

            if (this.GroupParameters.Length == 0)
            {
                Debug.LogError("Plant doesn't have any Group Parameters specified", this.gameObject);
                return;
            }

            for (int i = 0; i < this.GroupParameters.Length; i++)
            {
                BranchGroupParameters groupParameters = this.GroupParameters[i];

                if (groupParameters.MinCount < 0 || groupParameters.MaxCount < 0)
                {
                    Debug.LogError("Plant has invalid Min/Max count.  Min and Max must be greater than or equal to 0", this.gameObject);
                    return;
                }

                if (groupParameters.MinCount > groupParameters.MaxCount)
                {
                    Debug.LogError("Plant has invalid Min/Max count.  Min must be less than or equal to Max", this.gameObject);
                    return;
                }

                if (groupParameters.MinCount == 0 && groupParameters.MaxCount == 0)
                {
                    Debug.LogError("Plant have Min/Max both equal to 0.  That group will never be created.", this.gameObject);
                    return;
                }

                int branchTypeCount = Mathf.RoundToInt(RandomUtil.IntRangeInclusive(rand, groupParameters.MinCount, groupParameters.MaxCount));

                for (int j = 0; j < branchTypeCount; j++)
                {
                    if (groupParameters.Variations == null || groupParameters.Variations.Length == 0)
                    {
                        Debug.LogError("Plant has invalid number of Variations.  Must have at least 1.", this.gameObject);
                        return;
                    }

                    // creating the new branch
                    int        variationIndex = rand.Next(groupParameters.Variations.Length);
                    GameObject prototypePlant = groupParameters.Variations[variationIndex];

                    if (prototypePlant == null)
                    {
                        Debug.LogError(string.Format("Plant has null GameObject in Variation Element {0}.", variationIndex), this.gameObject);
                        return;
                    }

                    GameObject newBranch = Pooler.Instantiate(prototypePlant);

                    // setting up the base rotation
                    float baseRotation = 360 * ((float)j / (float)branchTypeCount);
                    baseRotation = suitableRotationSystem.GetSuitibleRotation(baseRotation);
                    suitableRotationSystem.AddDeadSpot(baseRotation, groupParameters.RotationalWidth);

                    // generating height offset
                    float height = RandomUtil.FloatRangeExclusive(rand, -groupParameters.VerticalOffset, groupParameters.VerticalOffset);

                    // setting the new plants transform values
                    newBranch.transform.parent           = transform;
                    newBranch.transform.localPosition    = new Vector3(0, height, 0);
                    newBranch.transform.localEulerAngles = new Vector3(0, baseRotation, 0);
                    newBranch.transform.localScale       = Vector3.one;

                    // setting the layer
                    if (layerId != -1)
                    {
                        newBranch.layer = layerId;
                    }

                    // setting the branch rotation (off of the base)
                    PlantGeneratorBranch plantBranch = newBranch.GetComponent <PlantGeneratorBranch>();
                    float addedRotation = RandomUtil.FloatRangeExclusive(rand, groupParameters.RandomRotationOffset, -groupParameters.RandomRotationOffset);
                    plantBranch.transform.localEulerAngles += new Vector3(0, addedRotation, 0);

                    // setting a random material on all renderers of this branch
                    if (groupParameters.Materials != null && groupParameters.Materials.Length > 0)
                    {
                        int      index       = rand.Next(groupParameters.Materials.Length);
                        Material newMaterial = groupParameters.Materials[index];

                        if (newMaterial != null)
                        {
                            var renderers = plantBranch.GetComponentsInChildren <Renderer>();

                            for (int r = 0; r < renderers.Length; r++)
                            {
                                renderers[r].sharedMaterial = newMaterial;
                            }
                        }
                    }
                }

                // if we got here then everything generated properly
                this.IsGenerated     = true;
                this.destroyChildren = true;
            }
        }