public void ActivateLens(ELensType lens) { LensFXObject newCurrent = null; switch (lens) { case ELensType.None: break; case ELensType.Flame: newCurrent = flame; break; case ELensType.Frost: newCurrent = frost; break; case ELensType.Lightning: newCurrent = lightning; break; default: break; } if (currentActive != null) { currentActive.gameObject.SetActive(false); } if (newCurrent != null) { currentActive = newCurrent; currentActive.gameObject.SetActive(true); } }
public Meta(EBodyType eBody, ELensType eLens, ELightType eLight) { scnt++; seq = scnt; Body = eBody; Lens = eLens; Light = eLight; }
public static void Main(string[] args) { EBodyType bodyType = EBodyType.EH_BA; ELensType lensType = ELensType.EH_L1; ELightType lightType = ELightType.LT_CLEAR; PictureFile pictureFile = new PictureFile("사진", bodyType, lensType, lightType); PictureFile pictureFile2 = new PictureFile("사진", bodyType, lensType, lightType); pictureFile.View(); pictureFile2.View(); }
public Meta MakeMeta(EBodyType bodyType, ELensType lensType, ELightType lightType) { foreach (var meta in metas) { if (meta.isEqual(bodyType, lensType, lightType)) { return(meta); } } Meta m = new Meta(bodyType, lensType, lightType); metas.Add(m); return(m); }
//This is gross, I know private void CycleAbility() { int loopSafety = 0; int index = (int)currentAbility; while (loopSafety < 4) { index = (int)Mathf.Repeat(index + 1f, 4); if (attacks[index].isUnlocked) { currentAbility = (ELensType)index; lensFXController.ActivateLens(currentAbility); return; } loopSafety++; } }
public PictureFile(string name, EBodyType bodyType, ELensType lensType, ELightType lightType) { MetaPool meta_pool = MetaPool.Singleton; meta = meta_pool.MakeMeta(bodyType, lensType, lightType); }
public bool isEqual(EBodyType bodyType, ELensType lensType, ELightType lightType) { return((bodyType == Body) && (lensType == Lens) && (Light == lightType)); }