Пример #1
0
    /** Starts a path specified by PathTypesDemo::activeDemo */
    public void DemoPath()
    {
        Path p = null;

        if (activeDemo == 0) {
            p = new Path (start.position,end.position, OnPathComplete);
        } else if (activeDemo == 1) {
            MultiTargetPath mp = new MultiTargetPath (multipoints.ToArray (), end.position, null, OnPathComplete);
            p = mp;
        } else if (activeDemo == 2) {
            RandomPath rp = new RandomPath (start.position,searchLength, OnPathComplete);
            rp.spread = spread;
            rp.aimStrength = aimStrength;
            rp.aim = end.position;
            rp.replaceChance = replaceChance;

            p = rp;
        } else if (activeDemo == 3) {
            FleePath fp = new FleePath (start.position, end.position, searchLength, OnPathComplete);
            fp.fleeStrength = aimStrength;
            fp.replaceChance = replaceChance;
            fp.spread = spread;

            p = fp;
        } else if (activeDemo == 4) {
            ConstantPath constPath = new ConstantPath (start.position, searchLength, OnPathComplete);

            p = constPath;
        }

        if (p != null) AstarPath.StartPath (p);
    }
Пример #2
0
        // Token: 0x06002761 RID: 10081 RVA: 0x001B14A5 File Offset: 0x001AF6A5
        public static RandomPath Construct(Vector3 start, int length, OnPathDelegate callback = null)
        {
            RandomPath path = PathPool.GetPath <RandomPath>();

            path.Setup(start, length, callback);
            return(path);
        }
Пример #3
0
        public static RandomPath Construct(Vector3 start, int length, [Optional, DefaultParameterValue(null)] OnPathDelegate callback)
        {
            RandomPath path = PathPool.GetPath <RandomPath>();

            path.Setup(start, length, callback);
            return(path);
        }