public List <StepPoint> CreateZonePointsOld()
        {
            int fullZoneCleranceInSteps = GetFullZoneCleranceInSteps();

            List <StepPoint> ZonePoints = new List <StepPoint>();

            for (int z = -fullZoneCleranceInSteps; z <= fullZoneCleranceInSteps; z += fullZoneCleranceInSteps)
            {
                int yCount = fullZoneCleranceInSteps - Math.Abs(z);

                for (int y = -yCount; y <= yCount; y += fullZoneCleranceInSteps)
                {
                    int xCount = yCount - Math.Abs(y);

                    for (int x = -xCount; x <= xCount; x += fullZoneCleranceInSteps)
                    {
                        if (x == 0 && y == 0 && z == 0)
                        {
                            continue;
                        }

                        StepPoint stepPoint = new StepPoint(x, y, z);
                        ZonePoints.Add(stepPoint);
                    }
                }
            }
            return(ZonePoints);
        }
Example #2
0
 public virtual void Start()
 {
     player    = Resources.Load("Prefabs/Player", typeof(Entity)) as Entity;
     pocong    = Resources.Load("Prefabs/Pocong", typeof(Entity)) as Entity;
     suster    = Resources.Load("Prefabs/Suster", typeof(Entity)) as Entity;
     stepPoint = Resources.Load("Prefabs/Step_Point", typeof(StepPoint)) as StepPoint;
 }
Example #3
0
    protected void spawnStepPoint(int index, Level level)
    {
        float x = (index % M) + 0.5f,
              y = (index / M) + 0.5f;

        StepPoint instance = Instantiate(stepPoint, new Vector3(x, y, 0.0f), Quaternion.identity);

        instance.setLevel(level);
    }
Example #4
0
        public List <StepPoint> Create()
        {
            List <StepPoint> ZonePoints = new List <StepPoint>();

            for (int z = -CLZInfo.FullDistanceInSteps; z <= CLZInfo.FullDistanceInSteps; z++)
            {
                for (int y = -CLZInfo.FullDistanceInSteps; y <= CLZInfo.FullDistanceInSteps; y++)
                {
                    for (int x = -CLZInfo.FullDistanceInSteps; x <= CLZInfo.FullDistanceInSteps; x++)
                    {
                        if (x == 0 && y == 0 && z == 0)
                        {
                            continue;
                        }

                        StepPoint stepPoint = new StepPoint(x, y, z);
                        ZonePoints.Add(stepPoint);
                    }
                }
            }
            return(ZonePoints);
        }