Пример #1
0
    //PlayAreaScript playAreaScript;

    public IEnumerator ManualStart(PlayAreaScript parentPlayAreaScript)
    {
        playArea          = parentPlayAreaScript;
        activeSquareState = new TargetSquareState();
//		activeSquareState.setOccupiedState (true);
//		print (activeSquareState.getOccupiedState());
        SpriteRenderer spriteRendererTemp = gameObject.GetComponent <SpriteRenderer>();

        if (spriteRendererTemp != null)
        {
            spriteRenderer = gameObject.GetComponent <SpriteRenderer>();
            //occupiedSprite =
            defaultSprite = spriteRenderer.sprite;
//			trueUntarget = spriteRenderer.sprite;
        }
        trueUntarget = defaultSprite;
        trueTarget   = targetMissedSprite;
        if (spriteRendererTemp == null)
        {
            Debug.Log("Cannot find 'spriteRendererTemp'object");
        }

//		GameObject playAreaTemp = GameObject.FindWithTag ("PlayAreaController");
//		if(playAreaTemp != null){
//			playArea = playAreaTemp.GetComponent<PlayAreaScript>();
//		}
//		if(playAreaTemp == null){
//			Debug.Log ("Cannot find 'playAreaImport'object");
//		}
        hardUntargetSquare();
        yield return(null);
    }
    public void SetupToggleable(byte x, byte y, PlayAreaScript _board)
    {
        xPosition = x;
        yPosition = y;

        mRenderer = GetComponent <MeshRenderer>();
        mRenderer.material.color = defaultColor;
        board             = _board;
        currentlySelected = false;
    }
Пример #3
0
//	bool bodypartIsDone = false;
//	bool playAreaIsDone = false;

    public IEnumerator ManualStart()
    {
        playAreaScript = gameObject.GetComponentInChildren <PlayAreaScript> ();
        StartCoroutine(playAreaScript.ManualStart());

        BpartMaker = gameObject.GetComponent <BodyPartMakerScript> ();

//		remainingHealth = healthMax;
        healthBarStartingScale = healthBarGraphic.localScale;
//		updateHealthDisplay ();

        StartCoroutine(BpartMaker.ManualStart());
        populateBody();
        playAreaScript.populateEnemyPlayAreaSquares();
        yield return(null);
    }
Пример #4
0
    private void PlayCard()
    {
        if (mainPlayArea != null)
        {
            PlayAreaScript playeArea = mainPlayArea.GetComponent <PlayAreaScript>();
            Card           card      = cardScript.card;

            if (Playable.isValidPlay(card.Value, playeArea.lastPlayedValue))
            {
                transform.SetParent(null, false);
                transform.position = Vector3.zero;
                gameObject.SetActive(false);
                cardScript.isPlayed = true;
                playeArea.PlayCard(cardScript.card);
            }
            else
            {
                transform.position = _initialPosition;
            }
        }
    }
Пример #5
0
 private void GetGameObjectReferences()
 {
     playAreaScript   = GameObject.Find("PlayArea").GetComponent <PlayAreaScript>();
     passButtonScript = GameObject.Find("PassButton").GetComponent <PassButtonScript>();
 }