private void setBtnActiveTime(ActionButtonScript actionBtn, long actionId)
    {
        switch (actionId)
        {
        //night action
        case (long)Action.AllAction.NightVote:
        case (long)Action.AllAction.Enchant:
        case (long)Action.AllAction.Kill:
        case (long)Action.AllAction.Reveal:
        case (long)Action.AllAction.Aura:
        case (long)Action.AllAction.Heal:
            actionBtn.activeTime = ActionButtonScript.ActiveTimeEnum.Night;
            break;

        //day action
        case (long)Action.AllAction.DayVote:
        case (long)Action.AllAction.ThrowHolyWater:
        case (long)Action.AllAction.Shoot:
            actionBtn.activeTime = ActionButtonScript.ActiveTimeEnum.Day;
            break;

        default:
            actionBtn.activeTime = ActionButtonScript.ActiveTimeEnum.Both;
            break;
        }
    }
示例#2
0
    // Start is called before the first frame update
    void Start()
    {
        if (PlayerTShirt1 != null)
        {
            PlayerTShirt1.GetComponent <Renderer>().material.color = hexToColor(CharacterColorPref.tshirtColor);
            PlayerTShirt2.GetComponent <Renderer>().material.color = hexToColor(CharacterColorPref.tshirtColor);
            PlayerTShirt3.GetComponent <Renderer>().material.color = hexToColor(CharacterColorPref.tshirtColor);

            PlayerPants1.GetComponent <Renderer>().material.color = hexToColor(CharacterColorPref.pantsColor);
            PlayerPants2.GetComponent <Renderer>().material.color = hexToColor(CharacterColorPref.pantsColor);

            PlayerShoes1.GetComponent <Renderer>().material.color = hexToColor(CharacterColorPref.shoesColor);
            PlayerShoes2.GetComponent <Renderer>().material.color = hexToColor(CharacterColorPref.shoesColor);
        }

        joystick   = FindObjectOfType <Joystick>();
        joybuttonA = FindObjectOfType <ActionButtonScript>();
        //joybuttonS = FindObjectOfType<SpecialButtonScript>();

        transform.position = spawnAera.position;
        player             = GameObject.FindGameObjectWithTag("Player");
        joystickH          = joystick.Horizontal;
        joystickV          = joystick.Vertical;

        Anim = GetComponent <Animator>();
        r    = GetComponent <Rigidbody>();
    }
示例#3
0
 // Use this for initialization
 void Start()
 {
     rb = this.gameObject.GetComponent <Rigidbody2D>();
     this.gameObject.transform.position = spawnPoint.transform.position;
     commandScript = spawnPoint.GetComponent <Command>();
     anim          = GetComponent <Animator>();
     actionScript  = actionButton.GetComponent <ActionButtonScript>();
 }
示例#4
0
    // Use this for initialization
    void Start()
    {
        DontDestroyOnLoad(this);
        if (!s1script)
        {
            s1script = spell1.GetComponent <ActionButtonScript>();
            s2script = spell2.GetComponent <ActionButtonScript>();
            s3script = spell3.GetComponent <ActionButtonScript>();
            s4script = spell4.GetComponent <ActionButtonScript>();
            s5script = spell5.GetComponent <ActionButtonScript>();
            sLscript = spellL.GetComponent <ActionButtonScript>();
            sRscript = spellR.GetComponent <ActionButtonScript>();
        }

        fpsArray = new Queue <int>();
    }
示例#5
0
 public void UpdateActionbar()
 {
     if (!s1script)
     {
         s1script = spell1.GetComponent <ActionButtonScript>();
         s2script = spell2.GetComponent <ActionButtonScript>();
         s3script = spell3.GetComponent <ActionButtonScript>();
         s4script = spell4.GetComponent <ActionButtonScript>();
         s5script = spell5.GetComponent <ActionButtonScript>();
         sLscript = spellL.GetComponent <ActionButtonScript>();
         sRscript = spellR.GetComponent <ActionButtonScript>();
     }
     s1script.SetSpell(playerSpells.GetSelectedSpell(PlayerSpells.SpellSlots.Slot1));
     s2script.SetSpell(playerSpells.GetSelectedSpell(PlayerSpells.SpellSlots.Slot2));
     s3script.SetSpell(playerSpells.GetSelectedSpell(PlayerSpells.SpellSlots.Slot3));
     s4script.SetSpell(playerSpells.GetSelectedSpell(PlayerSpells.SpellSlots.Slot4));
     s5script.SetSpell(playerSpells.GetSelectedSpell(PlayerSpells.SpellSlots.Slot5));
     sLscript.SetSpell(playerSpells.GetSelectedSpell(PlayerSpells.SpellSlots.LMB));
     sRscript.SetSpell(playerSpells.GetSelectedSpell(PlayerSpells.SpellSlots.RMB));
 }