can we get json result in c# controller code example

Example 1: can we write multiple trigger on an object salesforce

public class TestObjectTriggerHelper{

	public TestObjectTriggerHelper(){
		// constructor logic
	}
	public void beforeInsert(List<TestObject__c> newLst, List<TestObject__c> oldLst){
		// before insert action code block
		// method_1(); By calling different methods in other classes, you can change the order of execution also
		// method_2();
	}
	public void beforeUpdate(List<TestObject__c> newLst, List<TestObject__c> oldLst){
		// before update action code block
		// method_1();
		// method_2();
	}

	........
	...

	public void afterInsert(List<TestObject__c> newLst, List<TestObject__c> oldLst){
		// after insert action code block
		// method_1();
		// method_2();
	}
	public void afterUpdate(List<TestObject__c> newLst, List<TestObject__c> oldLst){
		// after update action code block
		// method_1();
		// method_2();
	}
	........
	....
}

Example 2: how do i limit the amount of prefabs in unity using c# script

int maxEnemy = 50; int enemyCount = 0;  void Spawn() {     if(enemyCount >= maxEnemy) return;     // Instantiate     enemyCount++; }