public void Start() { scoreText = GameObject.Find("ScoreText").GetComponent <TextMesh>(); mainCamera = GameObject.Find("Main Camera").GetComponent <Camera>(); cameraPos = mainCamera.transform.position; var cubePull = new GameObjectPull(cube); var capsulePull = new GameObjectPull(capsule); level = new LevelData(cubePull, capsulePull); CreateLevel(); }
private IEnumerator effectCoroutine(GameObjectPull<EffectWithSound> effectsPull, Vector3 position, bool changeRotation) { EffectWithSound effect = effectsPull.GetObject(); effect.transform.localScale = Vector3.one; effect.transform.position = position; if (changeRotation) { effect.transform.rotation = transform.rotation; } effect.gameObject.SetActive(true); effect.Play(); yield return new WaitForSeconds(effect.Duration); effectsPull.ReleaseObject(effect); }
public LevelData(GameObjectPull groundPull, GameObjectPull crystalPull) { this.groundPull = groundPull; this.crystalPull = crystalPull; }
// Use this for initialization void Start() { bulletsPull = new GameObjectPull <Bullet>(gameObject.AddChild("bulletsPull"), prefab, 30); effectsPull = new GameObjectPull <ParticleSystem>(gameObject.AddChild("effectsPull"), explosionPrefab, 30); camera = FindObjectOfType <Camera>(); }
private void Awake() { cellsPull = new GameObjectPull<Cell>(pullContainer, cellPrefab, 64, 10); }
private void Awake() { cellsPull = new GameObjectPull <Cell>(pullContainer, cellPrefab, 64, 10); }
void Start () { bulletsPull = new GameObjectPull<Bullet>(new GameObject("BulletsPull"), prefab, 30); shootsPull = new GameObjectPull<EffectWithSound>(new GameObject("ShootPull"), shootEffect, 30); explosionsPull = new GameObjectPull<EffectWithSound>(new GameObject("ExplosionsPull"), explosionEffect, 30); }
// Use this for initialization void Start() { cubesPull = new GameObjectPull <Vulnerable>(gameObject.AddChild("CubesPull"), prefab, 50, 10); }