virtual protected bool DistrustMoves()
    {
        if (distrustPlayerState != RunningState.Inactive)
        {
            if (distrustCMDNo == enumPan.transform.childCount)
            {
                enumPan.ResetRunningState();
                distrustPlayerState = RunningState.Inactive;
                return(false);
            }
            enumPan.SetRunningState(distrustCMDNo, EnumPanel.Status.Executing);
            distrustPlayerState = RunningState.NotReady;
            distrustOldCounter  = distrust.counter;
            TopCommand.Code topCodeToRun = distrustTopCode[distrustCMDNo];
            if (topCodeToRun == TopCommand.Code.Inbox)
            {
                distrust.SetEndPosition(distrustInboxPos);
            }
            else if (distrustSubCode[distrustCMDNo] != SubCommand.Code.NoAction)
            {
                SetEndPositionBySubCMD(distrust, distrustSubCode[distrustCMDNo]);
            }
        }

        return(true);
    }
    TopCommand spawnCommand(TopCommand.Code code)
    {
        TopCommand cloneCommand = null;

        switch (code)
        {
        case TopCommand.Code.Inbox:
            cloneCommand = Instantiate(Resources.Load("InboxPrefab", typeof(TopCommand))) as TopCommand;
            break;

        case TopCommand.Code.Outbox:
            cloneCommand = Instantiate(Resources.Load("OutboxPrefab", typeof(TopCommand))) as TopCommand;
            break;

        case TopCommand.Code.Load:
            cloneCommand = Instantiate(Resources.Load("LoadPrefab", typeof(TopCommand))) as TopCommand;
            break;

        case TopCommand.Code.Store:
            cloneCommand = Instantiate(Resources.Load("StorePrefab", typeof(TopCommand))) as TopCommand;
            break;
        }
        cloneCommand.gameObject.AddComponent <DragHandler> ();
        return(cloneCommand);
    }
Beispiel #3
0
    void Start()
    {
        distrustTopCode    = new TopCommand.Code[6];
        distrustSubCode    = new SubCommand.Code[6];
        distrustTopCode[0] = TopCommand.Code.Inbox;
        distrustSubCode[0] = SubCommand.Code.NoAction;
        distrustTopCode[1] = TopCommand.Code.Store;
        distrustSubCode[1] = SubCommand.Code.One;
        distrustTopCode[2] = TopCommand.Code.Inbox;
        distrustSubCode[2] = SubCommand.Code.NoAction;
        distrustTopCode[3] = TopCommand.Code.Outbox;
        distrustSubCode[3] = SubCommand.Code.Distrust;
        distrustTopCode[4] = TopCommand.Code.Load;
        distrustSubCode[4] = SubCommand.Code.One;
        distrustTopCode[5] = TopCommand.Code.Outbox;
        distrustSubCode[5] = SubCommand.Code.Distrust;

        playerInbox.Initialise(new Vector2(-344f, 251f), InitialInboxGenerator());
        playerOutbox.Initialise(new Vector2(-83f, -171f));
        distrustInboxPos = new Vector2(-436f, -111f);
        distrustOutbox.Initialise(new Vector2(-83f, 132f));
        memoryBar.Initialise(InitialMemoryPickupPos());
        debugPan.debugButtons[(int)ButtonCode.Run].onClick.AddListener(() => StartRunning());
        debugPan.debugButtons[(int)ButtonCode.Stop].onClick.AddListener(() => Reset());
        linkMenuEntry();
        Reset();
    }