示例#1
0
 // 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>();
 }
示例#2
0
    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);
    }
示例#3
0
    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);
    }
示例#4
0
    public void SetSwitchOn(bool on, int groupId, int individualId)
    {
        RoomSwitch switchi = GetSwitch(groupId, individualId);

        switchi.on = on;
    }