示例#1
0
        private void SpawnHitEffect()
        {
            var textEffect = Instantiate(HitPrefab, gameObject.transform.position, Quaternion.identity);

            SpawnHelper.SetParentInHierarchy(textEffect, spawnParent);
            textEffect.transform.position = gameObject.transform.position;
            textEffect.GetComponentInChildren <HitTextScript>().SetHit(HitForce);
            Destroy(textEffect, 0.5f);
        }
示例#2
0
        private void InitBarrier(GameObject b)
        {
            if (SpawnParent != null)
            {
                SpawnHelper.SetParentInHierarchy(b, SpawnParent.gameObject);
            }

            var barrier = b.GetComponent <BarrierScript>();

            barrier.ExplosionParent = ExplosionParent;
            barrier.Life            = BarrierLife;
        }
示例#3
0
        void Update()
        {
            button.interactable = PlayerScript.Player.Money.GreaterThan(Hit.FromFullLife(Costs));

            if (spawnBall && ballScript == null && BallPrefab != null)
            {
                var spawnArea = GameScript.Game.Spawnarea;
                var bo        = SpawnHelper.TrySpawn(BallPrefab, spawnArea.transform.position, spawnArea.bounds.size, Quaternion.identity);
                if (bo != null)
                {
                    SpawnHelper.SetParentInHierarchy(bo, ballsSpawnParent);

                    //Debug.Log("Spawn Ball");
                    ballScript          = bo.GetComponent <BallScript>();
                    ballScript.HitForce = spawnBallForce;
                    ballScript.Speed    = Speed;
                    ballScript.Mass     = Mass;

                    spawnBall = false;
                }
            }

            PermanentEffect_FullUpgrade();
        }