コード例 #1
0
ファイル: GameLogic.cs プロジェクト: AndreyDeg/ZigZag
    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();
    }
コード例 #2
0
    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);
    }
コード例 #3
0
 public LevelData(GameObjectPull groundPull, GameObjectPull crystalPull)
 {
     this.groundPull  = groundPull;
     this.crystalPull = crystalPull;
 }
コード例 #4
0
ファイル: BulletsEmiter.cs プロジェクト: Mouserr/UnityShooter
 // 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>();
 }
コード例 #5
0
ファイル: Field.cs プロジェクト: Mouserr/MemoryQuads
 private void Awake()
 {
     cellsPull = new GameObjectPull<Cell>(pullContainer, cellPrefab, 64, 10);
 }
コード例 #6
0
ファイル: Field.cs プロジェクト: Mouserr/MemoryQuads
 private void Awake()
 {
     cellsPull = new GameObjectPull <Cell>(pullContainer, cellPrefab, 64, 10);
 }
コード例 #7
0
	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);
	}
コード例 #8
0
 // Use this for initialization
 void Start()
 {
     cubesPull = new GameObjectPull <Vulnerable>(gameObject.AddChild("CubesPull"), prefab, 50, 10);
 }