private void Start() { K_SpriteRenderer = gameObject.GetComponent <SpriteRenderer>(); K_DialogueTimer = 2.0f; if (K_VGUI = GameObject.Find("VGUI").GetComponent <VGUI>()) { } else { Debug.Log("Key Cannot find VGUI"); } }
private void Start() { T_SpriteRenderer = gameObject.GetComponent <SpriteRenderer>(); if (T_VGUI = GameObject.Find("VGUI").GetComponent <VGUI>()) { } else { Debug.Log("Teleporter cannot find VGUI"); } T_VGUITimer = 2.0f; T_StartVGUITimer = false; }
// Use this for initialization void Start() { //Find Objects if (PA_VGUI = GameObject.Find("VGUI").GetComponent <VGUI>()) { //Do nothing } else { Debug.Log("VGUI not found, PLayer Attack"); } if (PA_FindObject = GameObject.Find("Inventory")) { PA_Inventory = PA_FindObject.GetComponent <Inventory>(); } else { Debug.Log("Player Attack could not find Inventory"); } //Animation PA_Animator = gameObject.GetComponent <Animator>(); PA_AttackLeft = false; PA_AttackRight = false; PA_AttackUp = false; PA_AttackDown = false; PA_HasAttackedSword = false; //States PA_CurrentState = PA_States.Idle; PA_NewState = PA_States.Idle; PA_ChangeStates = false; PA_StateTimer = 0.1f; PA_ResetStateTimer = 0.2f; //Attack direction PA_PlayerController = gameObject.GetComponent <PlayerController>(); PA_AttackDirection = PA_PlayerController.P_PlayerDirection; PA_FreezeTimer = 0.1f; PA_Frozen = false; //Inflict Damage PA_SwordAttackDamage = 5; PA_AttackBoxSize = new Vector2(1.13f, 0.85f); PA_InflictDamage = false; PA_InflictDamageTimer = 0.3f; PA_HasInflictedDamage = false; }
private void Start() { if (N_VGUI = GameObject.Find("VGUI").GetComponent <VGUI>()) { //Do nothing } else { Debug.Log("NPC Could not find VGUI"); } N_DialogueCounter = 1; N_SpriteRenderer = gameObject.GetComponent <SpriteRenderer>(); N_Collider = gameObject.GetComponent <Collider2D>(); N_ShowDialogue = false; }
void Start() { if (FB_SceneName == "Spring" && FB_Spring) { Destroy(gameObject); } else if (FB_SceneName == "Autumn" && FB_Autumn) { Destroy(gameObject); } else if (FB_SceneName == "Summer" && FB_Summer) { Destroy(gameObject); } else if (FB_SceneName == "Winter" && FB_Winter) { Destroy(gameObject); } FB_InterimScreen = false; FB_FadeOutAnimator = FB_FadeOut.GetComponent <Animator>(); FB_SpriteRenderer = gameObject.GetComponent <SpriteRenderer>(); if (FB_VGUI = GameObject.Find("VGUI").GetComponent <VGUI>()) { } else { Debug.Log("Teleporter cannot find VGUI"); } FB_VGUITimer = 2.0f; FB_StartVGUITimer = false; if (FB_playerRB = GameObject.FindGameObjectWithTag("Player").GetComponent <Rigidbody2D>()) { } else { Debug.Log("Fade could not find playerRB"); } FB_playerRB.simulated = false; FB_FadeOutAnimator.SetBool("FadeOut", false); }
// Use this for initialization void Start() { Cursor.visible = false; P_lastPos = transform.position; P_IsSliding = true; P_SlideDir = Vector2.zero; P_RigidBody = gameObject.GetComponent <Rigidbody2D>(); P_Animator = gameObject.GetComponent <Animator>(); P_CanInteract = false; P_StartingPosition = gameObject.transform.position; P_AudioM = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <AudioManager>(); if (P_VGUI = GameObject.Find("VGUI").GetComponent <VGUI>()) { //Do nothing } else { Debug.Log("Could not find VGUI"); } }
// Start is called before the first frame update void Start() { CM_PlayerControl = true; CM_VGUI = GameObject.Find("VGUI").GetComponent <VGUI>(); }
//On start, create the database private void Start() { if (IN_VGUI = GameObject.Find("VGUI").GetComponent <VGUI>()) { //Do nothing } else { Debug.Log("VGUI not found"); } //Create a dummy object //Attach a script to it //Item = this script //Insert this object into the dictionary //Destroy this item. //The reason we need to do this is because MonoBehaviour does not like constructors so we cannot simply do Item = new InventoryItem...etc DummyObject = new GameObject(); DummyObject.AddComponent <InventoryItem>(); Item = DummyObject.GetComponent <InventoryItem>(); //InventoryItem(ItemName, IsMainWeapon, IsItem) //Main Weapons Item.InventoryItemInit("Sword", true, false, 1); IN_SetPreset("Sword", Item); Destroy(DummyObject); DummyObject = new GameObject(); DummyObject.AddComponent <InventoryItem>(); Item = DummyObject.GetComponent <InventoryItem>(); Item.InventoryItemInit("Axe", true, false, 2); IN_SetPreset("Axe", Item); Destroy(DummyObject); DummyObject = new GameObject(); DummyObject.AddComponent <InventoryItem>(); Item = DummyObject.GetComponent <InventoryItem>(); Item.InventoryItemInit("Spear", true, false, 3); IN_SetPreset("Spear", Item); Destroy(DummyObject); DummyObject = new GameObject(); DummyObject.AddComponent <InventoryItem>(); Item = DummyObject.GetComponent <InventoryItem>(); //Secondary Weapons Item.InventoryItemInit("DaggerPoison", false, false, 1); IN_SetPreset("DaggerPoison", Item); Destroy(DummyObject); DummyObject = new GameObject(); DummyObject.AddComponent <InventoryItem>(); Item = DummyObject.GetComponent <InventoryItem>(); Item.InventoryItemInit("DaggerBleeding", false, false, 2); IN_SetPreset("DaggerBleeding", Item); Destroy(DummyObject); DummyObject = new GameObject(); DummyObject.AddComponent <InventoryItem>(); Item = DummyObject.GetComponent <InventoryItem>(); Item.InventoryItemInit("Lightning", false, false, 3); IN_SetPreset("Lightning", Item); Destroy(DummyObject); DummyObject = new GameObject(); DummyObject.AddComponent <InventoryItem>(); Item = DummyObject.GetComponent <InventoryItem>(); Item.InventoryItemInit("Fire", false, false, 4); IN_SetPreset("Fire", Item); Destroy(DummyObject); DummyObject = new GameObject(); DummyObject.AddComponent <InventoryItem>(); Item = DummyObject.GetComponent <InventoryItem>(); Item.InventoryItemInit("Ice", false, false, 5); IN_SetPreset("Ice", Item); Destroy(DummyObject); DummyObject = new GameObject(); DummyObject.AddComponent <InventoryItem>(); Item = DummyObject.GetComponent <InventoryItem>(); Item.InventoryItemInit("GravityBall", false, false, 6); IN_SetPreset("GravityBall", Item); Destroy(DummyObject); DummyObject = new GameObject(); DummyObject.AddComponent <InventoryItem>(); Item = DummyObject.GetComponent <InventoryItem>(); //Items Item.InventoryItemInit("Key", false, true, 1); IN_SetPreset("Key", Item); Destroy(DummyObject); }