Пример #1
0
    GameObject MakeScoreObject(GirlType type, Vector3 position)
    {
        //go = (GameObject)Instantiate (scorePrefab [0], scorePrefab [0].transform.position + Random.insideUnitSphere * 0.75f, Quaternion.identity);
        Score go;

        switch (type)
        {
//		case GirlType.RED:
//			go = ObjectPool.instance.GetRedScoreFX ();
//			break;
        case GirlType.BLUE:
            go = ObjectPool.instance.GetBlueScoreFX();
            break;

        case GirlType.YELLOW:
            go = ObjectPool.instance.GetYellowScoreFX();
            break;

        default:
            go = ObjectPool.instance.GetBlueScoreFX();
            break;
        }
        go.transform.position = position;
        return(go.gameObject);
    }
Пример #2
0
    public void SubtractScore(GirlType type, int amount, Vector3 position)
    {
        score -= amount;

        GameObject scoreObject = MakeScoreObject(type, position);

        TextMeshPro textMesh = scoreObject.GetComponentInChildren <TextMeshPro> ();

        if (textMesh != null)
        {
            textMesh.text = "- " + amount;
        }

        totalScore.text = score + "";
    }
Пример #3
0
    void SetBoyType(GirlType newType)
    {
        switch (newType)
        {
        case GirlType.YELLOW:
            skin.materials[0].mainTexture = rand[0];
            break;

        case GirlType.BLUE:
            skin.materials[0].mainTexture = rand[1];
            break;
        }

        type = newType;
    }