protected override bool isSuitable(CubeManager mgr) { if (cubesInDecomposition.value.Count > 0) { return(mgr.IsTouchingNeighbourInCompose() && !mgr.IsInCompose()); } return(mgr.CanDecompose() && !mgr.IsInCompose()); }
protected override void makeAction(CubeManager mgr) { if (mgr.IsInCompose()) { cubesInDecomposition.value.Remove(mgr.transform); mgr.ToDecomposeWaiting(); } else { cubesInDecomposition.value.Add(mgr.transform); mgr.ToDecompose(); } }
public bool IsTouchingNeighbourInCompose() { foreach (Transform cube in GetNeighbourPlayCubesInTouch()) { CubeManager mgr = cube.GetComponent <CubeManager>(); if (mgr.IsInCompose()) { return(true); } } return(false); }
protected override bool isSuitable(CubeManager mgr) { if (cubesInDecomposition.value.Count > 0) { return mgr.IsTouchingNeighbourInCompose() && !mgr.IsInCompose(); } return mgr.CanDecompose() && !mgr.IsInCompose(); }
protected override bool isSuitable(CubeManager mgr) { return mgr.IsInCompose() || mgr.IsWaitingForDecompose(); }
protected override bool isSuitable(CubeManager mgr) { return(mgr.IsInCompose() || mgr.IsWaitingForDecompose()); }
private bool isNotSuitableForComposeAlready(Transform cube) { CubeManager mgr = cube.GetComponent <CubeManager>(); return(!isSuitable(mgr) && !mgr.IsInCompose()); }