示例#1
0
        /// <summary>
        /// Setup the Elevator with specified numOfFloors, floorHeight and stopCallback.
        /// The starting up of Elevator is position at floor 0 in the prefab.
        /// </summary>
        /// <param name="elvId">Elevator ID</param>
        /// <param name="numOfFloors">Number of floors.</param>
        /// <param name="floorHeight">Floor height.</param>
        /// <param name="speed">moving speed.</param>
        /// <param name="pausetime">wait time before moving again.</param>
        /// <param name="stopCallback">Stop callback.</param>
        public void Setup(int elvId, int numOfFloors, float floorHeight, float speed, float pausetime, StateUpdateDelegate stopCallback)
        {
            this.elvId         = elvId;
            this.speed         = speed;
            this.liftPauseTime = pausetime;

            for (int i = 0; i < numOfFloors; i++)
            {
                float posY = transform.position.y + i * floorHeight / (5.5f * Screen.height / 640);
                floorPositionY.Add(posY);
            }
            stopNotify += stopCallback;
            UpdateElevatorVisual(true);
        }
示例#2
0
 void Start()
 {
     state = CombatantActionState.Waiting;
     StateUpdate = WaitingUpdate;
 }
示例#3
0
    protected void GoToNextState()
    {
        canGoToNextState = false;

        switch(state) {
        case CombatantActionState.Waiting:
            state = CombatantActionState.PrecastSetup;
            StateUpdate = PrecastSetupUpdate;
            break;
        case CombatantActionState.PrecastSetup:
            state = CombatantActionState.Precast;
            StateUpdate = PrecastUpdate;
            break;
        case CombatantActionState.Precast:
            state = CombatantActionState.Cast;
            StateUpdate = CastUpdate;
            break;
        case CombatantActionState.Cast:
            state = CombatantActionState.Done;
            break;
        default:
            break;
        }
    }
示例#4
0
        private void DoConvert(object sender, RoutedEventArgs e)
        {
            Files docs = (Files)this.Resources["FileList"];
            Progress.Maximum = docs.FileTotle;
            Progress.Value = 0;

            var UIcallback = new StateUpdateDelegate(StateUpdate);
            FileConvertDelegate asyncFileConvert = new FileConvertDelegate(Convertor.ConvertFiles);
            asyncFileConvert.BeginInvoke(docs, UIcallback, new AsyncCallback (Convertor.EndConvert) , null);
        }