void Awake() { instance = this; //QualitySettings.vSyncCount=1; //Application.targetFrameRate=60; //get the unit in game player = (UnitPlayer)FindObjectOfType(typeof(UnitPlayer)); //setup the collision rules Physics.IgnoreLayerCollision(TDS.GetLayerShootObject(), TDS.GetLayerShootObject(), !shootObject); Physics.IgnoreLayerCollision(TDS.GetLayerShootObject(), TDS.GetLayerCollectible(), !collectible); Physics.IgnoreLayerCollision(TDS.GetLayerShootObject(), TDS.GetLayerTerrain(), true); Physics.IgnoreLayerCollision(TDS.GetLayerShootObject(), TDS.GetLayerTrigger(), true); //clear all the spawner and tracker sicne it's a new game UnitTracker.Clear(); UnitSpawnerTracker.Clear(); //this is not required, each individual unit and spawner will register itself to the tracker //UnitTracker.ScanForUnit(); //UnitSpawnerTracker.ScanForSpawner(); }
void UpdateSphereCastMask(bool ignoreFriendly, bool ignoreSO, bool ignoreCollectible) { mask = ~(1 << TDS.GetLayerTrigger()); if (ignoreFriendly) { mask &= ~(1 << srcLayer); } if (ignoreSO) { mask &= ~(1 << TDS.GetLayerShootObject()); } if (ignoreCollectible) { mask &= ~(1 << TDS.GetLayerCollectible()); } }
public virtual void Awake() { gameObject.layer = TDS.GetLayerTrigger(); }