Пример #1
0
    public virtual void Init()
    {
        thisObject = GetComponent <BasicObject>();

        ObjectType objectType = thisObject.GetObjectType();

        for (int i = 0; i < avoidObjectRuleMaps.Count; ++i)
        {
            avoidObjectRuleMaps[i].Init(objectType);
        }
    }
Пример #2
0
    // Check whether this object can be spawned if all rules are passed
    public bool CanSpawnObject(float distance)
    {
        for (int i = 0; i < rules.Count; ++i)
        {
            ObjectType targetObjectType = targetObject != null?targetObject.GetObjectType() : ObjectType.Count;

            if (!rules[i].CanSpawnObject(distance, thisObjectType, targetObjectIndex, targetObjectType))
            {
                return(false);
            }
        }
        return(true);
    }