private void PCCheckTerrain_CheckingTerrain(object sender, CheckingTerrainEventArgs e) { if (!GetComponent <LocalManager>().MatchID(e.ObjectID)) { return; } bool isPassable = false; GameCore.AxeManCore.GetComponent <SearchObject>() .Search(e.Position[0], e.Position[1], out GameObject[] targets); foreach (GameObject go in targets) { if ((go.GetComponent <MetaInfo>().MainTag == MainTag.Actor) || (go.GetComponent <MetaInfo>().MainTag == MainTag.Altar)) { isPassable = false; break; } else if (go.GetComponent <MetaInfo>().MainTag == MainTag.Floor) { isPassable = true; } } e.IsPassable.Push(isPassable); }
private void MarkerCheckTerrain_CheckingTerrain(object sender, CheckingTerrainEventArgs e) { if (!GetComponent <LocalManager>().MatchID(e.ObjectID)) { return; } e.IsPassable.Push(GameCore.AxeManCore.GetComponent <SearchObject>() .Search(e.Position[0], e.Position[1], SubTag.Floor, out _)); }
public bool IsPassable(int[] position) { CheckingTerrainEventArgs e = new CheckingTerrainEventArgs( gameObject.GetInstanceID(), position, new Stack <bool>()); GameCore.AxeManCore.GetComponent <PublishPosition>().CheckTerrain(e); while (e.IsPassable.Count > 0) { if (!e.IsPassable.Pop()) { return(false); } } return(true); }