示例#1
0
 public override void setActionSet(PanelActionSetBase actionSet)
 {
     base.setActionSet(actionSet);
     _prevOnState = actionSet.currentVariantIndex == 0;
     switchBody.transform.localEulerAngles = new Vector3(_prevOnState ? 1 : -1, 0, 0);
     label.text = _actionSet.panelLabel;
 }
示例#2
0
 public override void setActionSet(PanelActionSetBase actionSet)
 {
     base.setActionSet(actionSet);
     _prevOnState = actionSet.currentVariantIndex == 0;
     switchBody.transform.localEulerAngles = new Vector3(_prevOnState ? 1 : -1, 0, 0);
     label.text = _actionSet.panelLabel;
 }
 public CreatePanelMessage(PanelActionSetBase actionSet, int x, int y, int prefabIndex)
 {
     _actionSet   = actionSet;
     _x           = x;
     _y           = y;
     _prefabIndex = prefabIndex;
 }
示例#4
0
 public CreatePanelMessage(PanelActionSetBase actionSet, int x, int y, int prefabIndex)
 {
     _actionSet = actionSet;
     _x = x;
     _y = y;
     _prefabIndex = prefabIndex;
 }
示例#5
0
 public override void setActionSet(PanelActionSetBase actionSet)
 {
     base.setActionSet(actionSet);
     slider.numberOfDots = actionSet.getVariantCount();
     slider.SetWidgetValue(_actionSet.currentVariantIndex / (_actionSet.getVariantCount() - 1.0f));
     label.text         = _actionSet.panelLabel;
     slider.EndHandler += onRelease;
 }
示例#6
0
 public override void setActionSet(PanelActionSetBase actionSet)
 {
     base.setActionSet(actionSet);
     slider.numberOfDots = actionSet.getVariantCount();
     slider.SetWidgetValue(_actionSet.currentVariantIndex / (_actionSet.getVariantCount() - 1.0f));
     label.text = _actionSet.panelLabel;
     slider.EndHandler += onRelease;
 }
示例#7
0
    public override void setActionSet(PanelActionSetBase actionSet)
    {
        base.setActionSet(actionSet);

        if (actionSet.getVariantCount() == 1) {
            button.ToggleState = false;
            button.BotGraphicsOffColor = button.BotGraphicsOnColor;
            button.MidGraphicsOffColor = button.MidGraphicsOnColor;
        } else {
            button.ToggleState = actionSet.currentVariantIndex == VARIANT_ON;
        }

        button.onToggle += onToggle;
        label.text = _actionSet.panelLabel;
    }
    public override void setActionSet(PanelActionSetBase actionSet)
    {
        base.setActionSet(actionSet);

        if (actionSet.getVariantCount() == 1)
        {
            button.ToggleState         = false;
            button.BotGraphicsOffColor = button.BotGraphicsOnColor;
            button.MidGraphicsOffColor = button.MidGraphicsOnColor;
        }
        else
        {
            button.ToggleState = actionSet.currentVariantIndex == VARIANT_ON;
        }

        button.onToggle += onToggle;
        label.text       = _actionSet.panelLabel;
    }
示例#9
0
    public override void Deserialize(NetworkReader reader)
    {
        base.Deserialize(reader);

        byte setType = reader.ReadByte();
        switch (setType) {
            case (byte)0: _actionSet = new SinglePanelActionSet(); break;
            case (byte)1: _actionSet = new ReplacementPanelActionSet(); break;
            case (byte)2: _actionSet = new CodePanelActionSet(); break;
            default: throw new Exception("Unexpected Action Set ID " + setType);
        }

        _actionSet.Deserialize(reader);

        _x = reader.ReadInt32();
        _y = reader.ReadInt32();
        _prefabIndex = reader.ReadInt32();
    }
示例#10
0
    private IEnumerator nextLevelCoroutine(float extraWait = 0.0f)
    {
        yield return(new WaitForSeconds(extraWait));

        _idToPanelActionSets.Clear();
        _connectionIdToPanelIds.Clear();
        _currentInstructions.Clear();

        int playerCount = CustomLobbyManager.allConnections.Count();

        List <List <CreatePanelMessage> > allPanels = PanelGenerator.generateAllPanelsForAllPlayers(playerCount);

        int index = 0;

        foreach (NetworkConnection connection in CustomLobbyManager.allConnections)
        {
            foreach (CreatePanelMessage createPanelMessage in allPanels[index])
            {
                PanelActionSetBase actionSet = createPanelMessage.actionSet;

                _idToPanelActionSets[actionSet.setId] = actionSet;
                List <PanelActionSetBase> idList;
                if (!_connectionIdToPanelIds.TryGetValue(connection.connectionId, out idList))
                {
                    idList = new List <PanelActionSetBase>();
                    _connectionIdToPanelIds[connection.connectionId] = idList;
                }
                idList.Add(actionSet);

                createPanelMessage.sendToClient(connection);
            }
            index++;
        }

        yield return(new WaitForSeconds(5.0f));

        _canInstruct = true;

        foreach (var connection in CustomLobbyManager.allConnections)
        {
            issueNewInstruction(connection.connectionId);
        }
    }
    public override void Deserialize(NetworkReader reader)
    {
        base.Deserialize(reader);

        byte setType = reader.ReadByte();

        switch (setType)
        {
        case (byte)0: _actionSet = new SinglePanelActionSet(); break;

        case (byte)1: _actionSet = new ReplacementPanelActionSet(); break;

        case (byte)2: _actionSet = new CodePanelActionSet(); break;

        default: throw new Exception("Unexpected Action Set ID " + setType);
        }

        _actionSet.Deserialize(reader);

        _x           = reader.ReadInt32();
        _y           = reader.ReadInt32();
        _prefabIndex = reader.ReadInt32();
    }
示例#12
0
 public override void setActionSet(PanelActionSetBase actionSet)
 {
     base.setActionSet(actionSet);
     label.text        = actionSet.panelLabel;
     toggleButton.isOn = actionSet.currentVariantIndex == VARIANT_ON;
 }
示例#13
0
 public override void setActionSet(PanelActionSetBase actionSet)
 {
     base.setActionSet(actionSet);
     label.text = actionSet.panelLabel;
 }
示例#14
0
 public override void setActionSet(PanelActionSetBase actionSet)
 {
     base.setActionSet(actionSet);
     label.text = actionSet.panelLabel;
 }
示例#15
0
 public override void setActionSet(PanelActionSetBase actionSet)
 {
     base.setActionSet(actionSet);
     label.text = actionSet.panelLabel;
     toggleButton.isOn = actionSet.currentVariantIndex == VARIANT_ON;
 }
示例#16
0
 public virtual void setActionSet(PanelActionSetBase actionSet)
 {
     _actionSet = actionSet;
 }
示例#17
0
 public virtual void setActionSet(PanelActionSetBase actionSet)
 {
     _actionSet = actionSet;
 }