Esempio n. 1
0
        protected override bool Begin(IStateMachine <AIAttributes, object> stateMachine)
        {
            objectSensor = Agent.Sensors.Get <ObjectSensor>();
            if (objectSensor == null)
            {
                return(false);
            }

            resourceType = (ResourceTypes)Agent.Memory.Get(AIAttributes.ResourceGoalType);
            if (resourceType == ResourceTypes.None)
            {
                return(false);
            }

            timeStartedScanning = Time.time;

            return(true);
        }
Esempio n. 2
0
        public override bool CheckComponents()
        {
            resourceType = Agent.Memory.Get <ResourceTypes>(AIAttributes.ResourceGoalType);
            if (resourceType == ResourceTypes.None)
            {
                return(false);
            }

            objectSensor = Agent.Sensors.Get <ObjectSensor>();
            if (objectSensor == null)
            {
                return(false);
            }

            var foundDeposit = objectSensor.IsObjectObtainable <ResourceDeposit>(r => r.resourceType == resourceType);

            return(foundDeposit);
        }