// Use this for initialization void Start() { rb = GetComponent <Rigidbody> (); currentHealth = maxHealth; changeHealthScript = GameObject.Find("HeartManager").GetComponent <ChangeHealth> (); anim = GetComponent <Animator> (); cameraScript = GameObject.FindWithTag("MainCamera").GetComponent <RoomSwitch> (); swordScript = GetComponent <SwordDirection> (); inventoryScript = GetComponent <Inventory> (); bowScript = GetComponent <Bow> (); boomerScript = GetComponent <boomerang>(); }
public RoomSwitch GetSwitch(int groupId, int individualId) { foreach (RoomSwitch switchi in switchs) { if (switchi.groupId == groupId && switchi.individualId == individualId) { return(switchi); } } RoomSwitch switchis = AddSwitch(groupId, individualId); return(switchis); }
public RoomSwitch AddSwitch(int groupId, int individualId) { foreach (RoomSwitch switchu in switchs) { if (switchu.groupId == groupId && switchu.individualId == individualId) { return(switchu); } } RoomSwitch switchi = new RoomSwitch(groupId, individualId, this); switchs.Add(switchi); return(switchi); }
public void SetSwitchOn(bool on, int groupId, int individualId) { RoomSwitch switchi = GetSwitch(groupId, individualId); switchi.on = on; }