Exemplo n.º 1
0
	// Use this for initialization
	void Start () {
		tempStateHolder = GameObject.Find ("TempState");
		if (tempStateHolder) {
			tempState = tempStateHolder.GetComponent<TempState> ();
			tempState.state ["playerOne"] = "Red";
			tempState.state ["playerTwo"] = "Green";
		}
	}
        public GameManagerAppWorker(string[] args)
            : base(new GameManagerConversationFactory())
        {
            GameInfo = new GameInfo();

            StartUpState = new StartUpState(this, args);
            TempState    = new TempState(this);
            currentState = StartUpState;
        }
Exemplo n.º 3
0
    void Start()
    {
        //Initialize some physics.
		Physics2D.gravity = new Vector2(0.0f, -10.0f);
		tempStateHolder = GameObject.Find ("TempState");
		if (tempStateHolder) {
			tempState = tempStateHolder.GetComponent<TempState> ();
		}
    }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     tempStateHolder = GameObject.Find("TempState");
     tempState       = tempStateHolder.GetComponent <TempState> ();
     if (tempState)
     {
         print("NEW SCENE LOAD : " + tempState.char1);
     }
 }
Exemplo n.º 5
0
    void Awake()
    {
        // Checks for conflicting instances
        if (Instance == null)
        {
            Instance = this;
        }

        DontDestroyOnLoad(gameObject);
    }
Exemplo n.º 6
0
	void Awake () {
		// Checks for conflicting instances
		if (Instance == null) {
			Instance = this;
			state = new Dictionary<string, string>();
		} else if (Instance != this) {
			Destroy (gameObject);
		}

		DontDestroyOnLoad (gameObject);
	}
        public override string ToString()
        {
            string returnval = "";

            if (PrinterState != null)
            {
                returnval += PrinterState.ToString() + "SDState: " + SDState + "\n";
            }
            if (TempState != null)
            {
                returnval += TempState.ToString();
            }
            return(returnval);
        }
Exemplo n.º 8
0
	// Use this for initialization
	void Start () {
		tempStateHolder = GameObject.Find ("TempState");
		if (tempStateHolder) {
			tempState = tempStateHolder.GetComponent<TempState> ();
		}
		if (tempState) {

			if (tempState.state["playerOne"] == tempState.state["playerTwo"]) {
				p2.GetComponent<Renderer> ().material.SetColor ("_Color", new Color(.6f, .6f, .6f, 1f));
			}
			if (tempState.state["playerOne"] == "Green") {
				p1rot.RotationAngle = 90;
                p1chargeRot.RotationAngle = 90;
                p1Portrait.GetComponent<Image>().color = Color.green;
			} else if (tempState.state["playerOne"] == "Blue") {
				p1rot.RotationAngle = 240;
				p1chargeRot.RotationAngle = 240;
                p1Portrait.GetComponent<Image>().color = Color.blue;
            } else if (tempState.state["playerOne"] == "Purple") {
				p1rot.RotationAngle = 300;
				p1chargeRot.RotationAngle = 300;
                p1Portrait.GetComponent<Image>().color = Color.magenta;
            } else {
				p1rot.RotationAngle = 0;
				p1chargeRot.RotationAngle = 0;
                p1Portrait.GetComponent<Image>().color = Color.red;
                Debug.Log(p1rot.rotateColor());
            }
			if (tempState.state["playerTwo"] == "Red") {
				p2rot.RotationAngle = 0;
				p2chargeRot.RotationAngle = 0;
                p2Portrait.GetComponent<Image>().color = Color.red;
            } else if (tempState.state["playerTwo"] == "Blue") {
				p2rot.RotationAngle = 240;
				p2chargeRot.RotationAngle = 240;
                p2Portrait.GetComponent<Image>().color = Color.blue;
            } else if (tempState.state["playerTwo"] == "Purple") {
				p2rot.RotationAngle = 300;
				p2chargeRot.RotationAngle = 300;
                p2Portrait.GetComponent<Image>().color = Color.magenta;
            } else {
				p2rot.RotationAngle = 90;
				p2chargeRot.RotationAngle = 90;
                p2Portrait.GetComponent<Image>().color = Color.green;
            }
		}
	}
Exemplo n.º 9
0
        /// <summary>
        /// Release a temporary notification so it can be recycled for later use. The notification should have been created using
        /// a static Create method on the notification type itself.
        /// </summary>
        /// <param name="notif"></param>
        public static void Release(Notification notif)
        {
            if (notif == null)
            {
                throw new System.ArgumentNullException("notif");
            }
            if (_tempNotifTable == null)
            {
                return;
            }

            var       tp = notif.GetType();
            TempState state;

            if (!_tempNotifTable.TryGetValue(tp, out state))
            {
                return; //if the key wasn't in there, then this notif type shouldn't be cached
            }
            if (state != null)
            {
                if (state.Notif != null)
                {
                    return;
                }

                state.Notif = notif;
            }
            else
            {
                state               = new TempState();
                state.Notif         = notif;
                state.Fields        = tp.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
                _tempNotifTable[tp] = state;
            }

            foreach (var f in state.Fields)
            {
                try
                {
                    f.SetValue(notif, null);
                }
                catch { }
            }
        }
Exemplo n.º 10
0
        public static void Reset()
        {
            TempState = TempState.NONE;

            if (_remoteGuideDict != null)
            {
                _remoteGuideDict.Clear();
                _remoteGuideDict = null;
            }

            _isStepup = false;

            if (_guideModule != null)
            {
                _guideModule.Remove(0);
                _guideModule = null;
            }

            _openDict = new Dictionary <ModulePB, List <FunctionEntryPB> >();
        }
Exemplo n.º 11
0
	// Use this for initialization
	void Start ()
    {
        fader = FindObjectOfType<ScreenFader>();
        Debug.Log(fader);
        fader.FadeToClear();

        tempStateHolder = GameObject.Find ("TempState");
		if (tempStateHolder) {
			tempState = tempStateHolder.GetComponent<TempState> ();
		}
		if (tempState.state ["Winner"] == "Player") {
            results.text = "PLAYER <b>1</b> VICTORY! (>^__^)>";

            p1UI.displayText.text = "1st place: Player 1!";
            p2UI.displayText.text = "2nd place: Player 2";
		} else if (tempState.state ["Winner"] == "Player 2") {
            results.text = "PLAYER <b>2</b> VICTORY! (>^__^)>";

            p1UI.displayText.text = "2nd place: Player 1";
            p2UI.displayText.text = "1st place: Player 2!";
        } else {
			results.text = "DRAW";
		}
	}
Exemplo n.º 12
0
 public UITemperature(double temp, TempState state, DateTime time, bool refresh) : this(time, refresh)
 {
     Temperature = temp;
     State       = state;
 }