Example #1
0
        public override void Action()
        {
            if (!CanInteract)
            {
                return;
            }

            if (currentStep < points.Length - 1)
            {
                Invoke("ActivateCanInteract", 1);
                CanInteract = false;
                currentStep++;
                Vector3 pos = points[currentStep].position;
                SituationInfoUI.Instance.SetNextStep(nameStep, currentStep);
                ManagerInteractItems.Instance.ShowPointMove(pos, currentStep);
                CanvasText.SetActive(true);
                CanvasText.transform.position = pos;
                CanvasText.transform.LookAt(Camera.main.transform);
            }
            else
            {
                CanInteract = false;
                ManagerInteractItems.Instance.PointMove.gameObject.SetActive(false);
                CanvasText.SetActive(false);
                TrainingStateManager.Instance.SetEndSituation();
            }
        }
Example #2
0
    public BoardPiece(CanvasGroup group, BoardPiece [] board, int x, int y, int i)
        : base(group, CanvasGroup.GType)
    {
        this.X        = (x * PIECE_SIZE);
        this.Y        = (y * PIECE_SIZE);
        this.Board    = board;
        this.Number   = i;
        this.Position = i;

        CanvasRect rect = new CanvasRect(this);

        rect.X1           = 0.0;
        rect.Y2           = 0.0;
        rect.X2           = PIECE_SIZE;
        rect.Y2           = PIECE_SIZE;
        rect.FillColor    = Color;
        rect.OutlineColor = "black";
        rect.WidthPixels  = 0;

        CanvasText text = new CanvasText(this);

        text.Text      = (i + 1).ToString();
        text.X         = PIECE_SIZE / 2.0;
        text.Y         = PIECE_SIZE / 2.0;
        text.Font      = "Sans Bold 24";
        text.Anchor    = AnchorType.Center;
        text.FillColor = "black";

        this.Text         = text;
        this.CanvasEvent += new Gnome.CanvasEventHandler(Piece_Event);
    }
Example #3
0
 public CanvasTextBox()
 {
     text = new CanvasText();
     text.Font = FontDescription.FromString ("sans 20");
     text.Text = "Hi, im editable!";
     text.Width =  205;
     text.Height = 100;
     Add (text);
 }
Example #4
0
    // Use this for initialization
    void Start()
    {
        mCurrentInst = 0;
        mCurrentStep = 0;

        mStepState = new List <List <bool> >(mInstCount);
        for (int ii = 0; ii < mInstCount; ii++)
        {
            List <bool> listA = new List <bool> (mStepCount);
            for (int si = 0; si < mStepCount; si++)
            {
                listA.Add(mPattern[ii][si]);
            }
            mStepState.Add(listA);
        }

        mAudioClip = new List <AudioClip> (mInstCount);
        mAudioClip.Add((AudioClip)Resources.Load("Audio/BD", typeof(AudioClip)));
        mAudioClip.Add((AudioClip)Resources.Load("Audio/CH", typeof(AudioClip)));
        mAudioClip.Add((AudioClip)Resources.Load("Audio/SD", typeof(AudioClip)));
        mAudioClip.Add((AudioClip)Resources.Load("Audio/CYM", typeof(AudioClip)));

        mInst = new List <GameObject>(mInstCount);

        mCanvasText = GameObject.Find("Text").GetComponent <CanvasText>();

        // BD は土台に設置済みとする
        GameObject cylinderRsc = (GameObject)Resources.Load("prefab/BDCylinder");
        GameObject cylinder    = Instantiate(cylinderRsc, new Vector3(0.0f, 0.2f, 0.0f), Quaternion.identity);

        cylinder.GetComponent <Cylinder>().SetupColor(Color.red);
        Pattern pattern = cylinder.GetComponent <Pattern> ();

        pattern.SetupClip(mAudioClip [0]);
        for (int i = 0; i < mStepCount; i++)
        {
            pattern.SetStepState(i, mPattern[mCurrentInst][i]);
        }
        mInst.Add(cylinder);
        mInst [mCurrentInst].GetComponent <Cylinder> ().GetComponent <Rigidbody> ().useGravity = true;
        mInst [mCurrentInst].GetComponent <Cylinder> ().SetStateLand(true);
        mCurrentInst++;

        // 初回は SN を落下
        cylinder = Instantiate(cylinderRsc, new Vector3(0.0f, 4.0f, 0.0f), Quaternion.identity);
        cylinder.GetComponent <Cylinder>().SetupColor(Color.yellow);
        pattern = cylinder.GetComponent <Pattern> ();
        pattern.SetupClip(mAudioClip [1]);
        for (int i = 0; i < mStepCount; i++)
        {
            pattern.SetStepState(i, mPattern[mCurrentInst][i]);
        }
        mInst.Add(cylinder);
        SetGameReady();
    }
Example #5
0
 private void OnEnable()
 {
     canHandRotate = false;
     //     rotateRood.Play("RoodStart");
     if (CanvasText != null)
     {
         CanvasText.SetActive(true);
     }
     if (spriteAlert != null)
     {
         spriteAlert.SetActive(true);
     }
     if (mapIdent != null)
     {
         mapIdent.SetActive(true);
     }
     if (ParticleOil != null)
     {
         var emission = ParticleOil.emission;
         var rate     = emission.rateOverTime;
         rate.constant         = emmisionOilSpill;
         emission.rateOverTime = rate;
     }
 }
Example #6
0
        public UMLEntry(
			UMLElement owner,
			DI.GraphNode graphNode,
			CanvasGroup group,
			bool isMovable,
			string text,
			string fontModifier
		)
            : base(group)
        {
            _graphNode = graphNode;
            Movable = isMovable;
            _owner = owner;
            _text = new CanvasText (this);
            _text.Text = (text == null ? System.String.Empty : text);
            _text.FillColor = "black";
            _text.CanvasEvent += EntryEvents;
            _text.Justification = Gtk.Justification.Left;
            _text.Anchor = Gtk.AnchorType.NorthWest;
            this.FontModifier = fontModifier;
            _root = group;
            X = _movable ? _graphNode.GlobalPosition.X : _graphNode.Position.X;
            Y = _movable ? _graphNode.GlobalPosition.Y : _graphNode.Position.Y;
            Show ();
        }
	public BoardPiece (CanvasGroup group, BoardPiece [] board, int x, int y, int i)
		: base (group, CanvasGroup.GType)
	{
		this.X = (x * PIECE_SIZE);
		this.Y = (y * PIECE_SIZE);
		this.Board = board;
		this.Number = i;
		this.Position = i;		

		CanvasRect rect = new CanvasRect (this);
		rect.X1 = 0.0;
		rect.Y2 = 0.0;
		rect.X2 = PIECE_SIZE;
		rect.Y2 = PIECE_SIZE;
		rect.FillColor = Color;
		rect.OutlineColor = "black";
		rect.WidthPixels = 0;
		
		CanvasText text = new CanvasText (this);
		text.Text = (i + 1).ToString ();
		text.X = PIECE_SIZE / 2.0;
		text.Y = PIECE_SIZE / 2.0;
		text.Font = "Sans Bold 24";
		text.Anchor = AnchorType.Center;
		text.FillColor = "black";

		this.Text = text;
		this.CanvasEvent += new Gnome.CanvasEventHandler (Piece_Event);
	}