コード例 #1
0
ファイル: SpawnRules.cs プロジェクト: imouto1994/jetrider
    // Check if the object is able to be spawned
    public virtual bool CanSpawnObject(float distance, ObjectSpawnData spawnData)
    {
        // Cannot spawn if the object is unable to spawn in the given ection
        if (!thisObject.CanSpawnInSection(spawnData.section))
        {
            return(false);
        }

        // Rules check
        for (int i = 0; i < avoidObjectRuleMaps.Count; ++i)
        {
            if (!avoidObjectRuleMaps[i].CanSpawnObject(distance))
            {
                return(false);
            }
        }
        return(true);
    }