예제 #1
0
    public void Init()
    {
//		System.Array facadeValues = System.Enum.GetValues (typeof(EFacadeType));
//		FacadeType = (EFacadeType)facadeValues.GetValue (UnityEngine.Random.Range (0, facadeValues.Length));

//		System.Array frameValues = System.Enum.GetValues (typeof(EFrameType));
//		FrameType = (EFrameType)facadeValues.GetValue (UnityEngine.Random.Range (0, frameValues.Length));

        System.Array patternColorValues = System.Enum.GetValues(typeof(EPatternColor));
        PatternColor = (EPatternColor)patternColorValues.GetValue(UnityEngine.Random.Range(0, patternColorValues.Length));
    }
예제 #2
0
    public void Init()
    {
        //		System.Array facadeValues = System.Enum.GetValues (typeof(EFacadeType));
        //		FacadeType = (EFacadeType)facadeValues.GetValue (UnityEngine.Random.Range (0, facadeValues.Length));

        //		System.Array frameValues = System.Enum.GetValues (typeof(EFrameType));
        //		FrameType = (EFrameType)facadeValues.GetValue (UnityEngine.Random.Range (0, frameValues.Length));

        System.Array patternColorValues = System.Enum.GetValues (typeof(EPatternColor));
        PatternColor = (EPatternColor)patternColorValues.GetValue (UnityEngine.Random.Range (0, patternColorValues.Length));
    }
예제 #3
0
    // Use this for initialization
//	void Start () {
//
//	}

    // Update is called once per frame
//	void Update () {
//
//	}

    public void Init(EPatternColor patternColor, bool _isTopFloor, bool _isBottomFloor, bool _isBasement)
    {
        isTopFloor    = _isTopFloor;
        isBottomFloor = _isBottomFloor;
        isBasement    = _isBasement;

        System.Array backgroundValues = System.Enum.GetValues(typeof(EBackgroundType));
        BackgroundType = (EBackgroundType)backgroundValues.GetValue(UnityEngine.Random.Range(0, backgroundValues.Length));

        if ((int)BackgroundType < BackgroundSprites.Count)
        {
            BackgroundSpriteRenderer.sprite = BackgroundSprites[(int)BackgroundType];
        }

        if (isTopFloor)
        {
            ForegroundSpriteRenderer.sprite = ForegroundTopSprites[0];
        }
        else if (isBottomFloor)
        {
            ForegroundSpriteRenderer.sprite = ForegroundBottomSprites[0];
        }
        else if (isBasement)
        {
            ForegroundSpriteRenderer.sprite = ForegroundBasementSprites[0];
        }
        else
        {
            ForegroundSpriteRenderer.sprite = ForegroundSprites[0];
        }

        BackgroundFrameSpriteRenderer.sprite = BackgroundFrameSprites [0];

        if (isBasement)
        {
            ForegroundPatternSpriteRenderer.sprite = null;
        }
        else
        {
            int variant = UnityEngine.Random.Range(0, 2);
            ForegroundPatternSpriteRenderer.sprite = ForegroundPatternSprites[((int)patternColor * 3) + variant];
        }
    }
예제 #4
0
    // Use this for initialization
    //    void Start () {
    //    
    //    }
    // Update is called once per frame
    //    void Update () {
    //    
    //    }
    public void Init(EPatternColor patternColor, bool _isTopFloor, bool _isBottomFloor, bool _isBasement)
    {
        isTopFloor = _isTopFloor;
        isBottomFloor = _isBottomFloor;
        isBasement = _isBasement;

        System.Array backgroundValues = System.Enum.GetValues(typeof(EBackgroundType));
        BackgroundType = (EBackgroundType)backgroundValues.GetValue(UnityEngine.Random.Range(0, backgroundValues.Length));

        if((int)BackgroundType < BackgroundSprites.Count)
            BackgroundSpriteRenderer.sprite = BackgroundSprites[(int)BackgroundType];

        if(isTopFloor)
        {
            ForegroundSpriteRenderer.sprite = ForegroundTopSprites[0];
        }
        else if(isBottomFloor)
        {
            ForegroundSpriteRenderer.sprite = ForegroundBottomSprites[0];
        }
        else if(isBasement)
        {
            ForegroundSpriteRenderer.sprite = ForegroundBasementSprites[0];
        }
        else
        {
            ForegroundSpriteRenderer.sprite = ForegroundSprites[0];
        }

        BackgroundFrameSpriteRenderer.sprite = BackgroundFrameSprites [0];

        if (isBasement)
        {
            ForegroundPatternSpriteRenderer.sprite = null;
        }
        else
        {
            int variant = UnityEngine.Random.Range(0, 2);
            ForegroundPatternSpriteRenderer.sprite = ForegroundPatternSprites[((int)patternColor * 3) + variant];
        }
    }