public static void Initialize() { currentLevel = 1; GlobalMediator.AddListener(RecieveEvents); cam = UnityEngine.Object.FindObjectOfType <Camera>().gameObject; firstLevelYPos = cam.transform.position.y; }
public static void Initialize() { shakeObj = new GameObject("@Screenshake Object"); shakeObj.transform.position = Vector3.zero; UnityEngine.Object.FindObjectOfType <Camera>().transform.SetParent(shakeObj.transform, true); GlobalMediator.AddListener(RecieveEvents); }
public void Awake() { initalized = true; filledHeart = Resources.Load <Sprite>("Sprites/HeartFilled"); emptyHeart = Resources.Load <Sprite>("Sprites/HeartEmpty"); p1Hearts = new List <SpriteRenderer>(); p2Hearts = new List <SpriteRenderer>(); GlobalMediator.AddListener(RecieveEvents); for (int i = 0; i < 3; i++) { SpriteRenderer heart = Instantiate(new GameObject("p1 heart " + i)).AddComponent <SpriteRenderer>(); p1Hearts.Add(heart); } for (int i = 0; i < 3; i++) { SpriteRenderer heart = Instantiate(new GameObject("p2 heart " + i)).AddComponent <SpriteRenderer>(); p2Hearts.Add(heart); } foreach (var item in p1Hearts) { item.sprite = filledHeart; item.gameObject.transform.localScale = Vector3.zero; } foreach (var item in p2Hearts) { item.sprite = filledHeart; item.gameObject.transform.localScale = Vector3.zero; } }
public override void Initialize(int playerNumber) { base.Initialize(playerNumber); GlobalMediator.AddListener(this); spriteTrail = GetComponent <SpriteTrail.SpriteTrail>(); toggleTrail(false); }
public override void Initialize(int playerNumber) { base.Initialize(playerNumber); rigi = GetComponent <Rigidbody2D>(); chargePower = minChargePower; GlobalMediator.AddListener(this); chargeDisplay.gameObject.SetActive(false); }
public override void Initialize(int playerNumber) { base.Initialize(playerNumber); allowedToMove = false; InputManager.SetPlayerNumberUpdateDevice(playerNumber, InputManager_OnChanges); InputManager_OnChanges(); GlobalMediator.AddListener(RecieveEvents); }
public override void Initialize(int playerNumber) { base.Initialize(playerNumber); GlobalMediator.AddListener(this); spriteRenderer = GetComponent <SpriteRenderer>(); foundAnimations = new Dictionary <string, Sprite[]>(); foundInfo = new Dictionary <string, UnitAnimationInfo>(); myCharacter = playerNumber == 1 ? Character.Blue : Character.Pink; myCharacterFolder = (myCharacter is Character.Blue) ? BlueFolder : PinkFolder; TryStartAnimation("Idle"); SetFrameRate("Idle"); NextFrame(); }
// Start is called before the first frame update void Awake() { allChilren = new List <Transform>(); foreach (var item in GetComponentsInChildren <Transform>()) { if (item.gameObject == this.gameObject) { continue; } allChilren.Add(item); } GlobalMediator.AddListener(RecieveEvents); foreach (var item in allChilren) { if (item.gameObject == this.gameObject) { continue; } item.gameObject.SetActive(false); } }
private void Start() { currenthealth = maxHealth; GlobalMediator.AddListener(this); }
public static void Initialize() { GlobalMediator.AddListener(RecieveEvents); }
private void OnEnable() { GlobalMediator.AddListener(this); }
public override void Initialize(int playerNumber) { base.Initialize(playerNumber); rb = GetComponent <Rigidbody2D>(); GlobalMediator.AddListener(this); }
public override void Initialize(int playerNumber) { base.Initialize(playerNumber); collider2d = GetComponent <Collider2D>(); GlobalMediator.AddListener(this); }
public override void Initialize(int playerNumber) { base.Initialize(playerNumber); GlobalMediator.AddListener(this); }
public static void Initialize() { GlobalMediator.AddListener(OnMediatorMessage); }
public static void Initialize() { GlobalMediator.AddListener(PlaySoundEvent); targetObject = new GameObject("@Wwise Audio Target"); }
public static void Initialize() { timer = 0; GlobalMediator.AddListener(RecieveEvent); }
void Start() { playersInGoal = 0; active = true; GlobalMediator.AddListener(RecieveEvents); }