Professional Documents
Culture Documents
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
void Update () {
transform.Translate(Vector2.left * currentSpeed * Time.deltaTime);
UpdateAnimationState();
}
using System.Collections.Generic;
using UnityEngine;
IEnumerator Start()
{
while(spawn)
{
yield return new WaitForSeconds(Random.Range(minSpawnDelay,
maxSpawnDelay));
SpawnAttacker();
}
}
public void StopSpawning()
{
spawn = false;
}
GetComponent<SpriteRenderer>().color = Color.white;
FindObjectOfType<DefenderSpawner>().SetSelectedDefender(defenderPrefab);
}
}
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
Defender defender;
GameObject defenderParent;
const string DEFENDER_PARENT_NAME = "Defenders";
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
if(otherObject.GetComponent<Gravestone>())
{
GetComponent<Animator>().SetTrigger("jumpTrigger");
}
else if (otherObject.GetComponent<Defender>())
{
GetComponent<Attacker>().Attack(otherObject);
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
if(attacker)
{
// TODO Add some sort of animation
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
IEnumerator HandleWinCondition()
{
winLabel.SetActive(true);
GetComponent<AudioSource>().Play();
yield return new WaitForSeconds(waitToLoad);
FindObjectOfType<LevelLoader>().LoadNextScene();
}
IEnumerator WaitForTime()
{
yield return new WaitForSeconds(timeToWait);
LoadNextScene();
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
void Start()
{
lives = baseLives - PlayerPrefsController.GetDifficulty();
livesText = GetComponent<Text>();
UpdateDisplay();
Debug.Log("difficulty setting currently is " +
PlayerPrefsController.GetDifficulty());
}
if (lives <= 0)
{
FindObjectOfType<LevelController>().HandleLoseCondition();
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
if (otherObject.GetComponent<Defender>())
{
GetComponent<Attacker>().Attack(otherObject);
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
AudioSource audioSource;
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
void Update ()
{
transform.Translate(Vector2.right * speed * Time.deltaTime);
}
}
}
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
void Start()
{
starText = GetComponent<Text>();
UpdateDisplay();
}
-136560
-76601.6
-78601.6
-122999.9
-126499.9
-76588