void Start() { if (inputManagerDatabase == null) { inputManagerDatabase = (InputManager)Resources.Load("InputManager"); } if (craftSystem != null) { cS = craftSystem.GetComponent <CraftSystem>(); } if (GameObject.FindGameObjectWithTag("Tooltip") != null) { toolTip = GameObject.FindGameObjectWithTag("Tooltip").GetComponent <Tooltip>(); } if (inventory != null) { mainInventory = inventory.GetComponent <Inventory>(); } if (characterSystem != null) { characterSystemInventory = characterSystem.GetComponent <Inventory>(); } if (craftSystem != null) { craftSystemInventory = craftSystem.GetComponent <Inventory>(); } characterSwitch = FindObjectOfType <CharacterSwitch>(); }
// David - gets the intial position and loads the models/gameobjects at start that was set in inspecter void Start() { targetPos = transform.position; playerInventory = player.GetComponent<PlayerInventory_JG>(); player = player.gameObject; switchBaby = switchBaby.gameObject; switchTeen = switchTeen.gameObject; switchOld = switchOld.gameObject; c_switch = player.GetComponent<CharacterSwitch>(); }
void Awake() { if (Instance != null) { Destroy(this.gameObject); return; } Instance = this; GameObject.DontDestroyOnLoad(this.gameObject); }
void OnTriggerEnter(Collider other) { CharacterSwitch cw = player.gameObject.transform.root.GetComponent <CharacterSwitch>(); if (other.tag == "Player") { unlockText.gameObject.SetActive(true); cw.character3Enabled = true; Destroy(yaeObject.gameObject); Destroy(this.gameObject, 5f); } }
void RpcChange(GameObject obj, int num) { // Get character switch of the obj CharacterSwitch local = obj.GetComponent <CharacterSwitch> (); // Set appropriate fields local.img.sprite = archer[num].archerImg; local.mov.ChangeSpeed(archer[num].speed, archer[num].jumpForce); local.health.ChangeHealth(archer[num].health); local.shoot.ChangeCd(archer[num].arrowPrefab, archer[num].attackCd, archer[num].shootDelay); local.anim.runtimeAnimatorController = archer [num].anim; }
void Update() { DamageDetector dd = player.gameObject.transform.root.GetComponent <DamageDetector>(); CharacterSwitch cw = player.gameObject.transform.root.GetComponent <CharacterSwitch>(); health.text = "Health: " + hpHud; lives.text = "Lives: 1"; if (dd.DamageTaken == 0) { hpHud = 3; } if (dd.DamageTaken == 1) { hpHud = 2; } if (dd.DamageTaken == 2) { hpHud = 1; } if (dd.DamageTaken == 3) { hpHud = 0; lives.text = "Lives: 0"; } if (CharacterSwitch.characterSwitch == 1) { char1.gameObject.SetActive(true); char2.gameObject.SetActive(false); char3.gameObject.SetActive(false); } if (CharacterSwitch.characterSwitch == 2) { char1.gameObject.SetActive(false); char2.gameObject.SetActive(true); char3.gameObject.SetActive(false); } if (CharacterSwitch.characterSwitch == 3) { char1.gameObject.SetActive(false); char2.gameObject.SetActive(false); char3.gameObject.SetActive(true); } }
// Start is called before the first frame update void Start() { characterSwitch = FindObjectOfType <CharacterSwitch>(); }
// Start is called before the first frame update void Start() { onboardingController = GetComponentInParent <BlimpOnboarding>(); blimpController = GetComponentInParent <BlimpController>(); characterSwitch = FindObjectOfType <CharacterSwitch>(); }