Exemple #1
0
	public void addTurn(int rotation) {
		if (turnCount == 0) {
			turnObj = GameObject.CreatePrimitive(PrimitiveType.Quad);
			turnObj.layer = LayerMask.NameToLayer("Lights");
			turnMod = turnObj.AddComponent<TurnLightsModel>();
			turnMod.init(this, rotation);
			turnCount++;
		}
//		else if (turnCount == 1) {
//			turnObj2 = GameObject.CreatePrimitive(PrimitiveType.Quad);
//			turnObj2.layer = LayerMask.NameToLayer("Lights");
//			turnMod2 = turnObj2.AddComponent<TurnLightsModel>();
//			turnMod2.init(this, rotation);
//			turnMod2.setActive(!turnMod.isActive());
//			turnCount++;
//		}
		else {
			print("No more than one turn signal per tile.");
		}
	}
Exemple #2
0
    public void addTurn(int rotation)
    {
        if (turnCount == 0)
        {
            turnObj       = GameObject.CreatePrimitive(PrimitiveType.Quad);
            turnObj.layer = LayerMask.NameToLayer("Lights");
            turnMod       = turnObj.AddComponent <TurnLightsModel>();
            turnMod.init(this, rotation);
            turnCount++;
        }
//		else if (turnCount == 1) {
//			turnObj2 = GameObject.CreatePrimitive(PrimitiveType.Quad);
//			turnObj2.layer = LayerMask.NameToLayer("Lights");
//			turnMod2 = turnObj2.AddComponent<TurnLightsModel>();
//			turnMod2.init(this, rotation);
//			turnMod2.setActive(!turnMod.isActive());
//			turnCount++;
//		}
        else
        {
            print("No more than one turn signal per tile.");
        }
    }