public void RegisterWarper(Warper warper) { #if DEBUG_WARPER_MANAGER Debug.LogFormat("Registering {0}", warper); #endif this.warper = warper; }
void Awake() { cachedTransform = transform; spriteRenderer = GetComponentInChildren <SpriteRenderer>(); //Create Warper warper = new Warper(cachedTransform); //Susbribe to game pause and game end events MessageBus.onGamePause += onGamePause; MessageBus.onGameEnd += onGameEnd; }
public void init(AsteroidManager asteroidManager, Vector3 position, Vector3 direction) { this.asteroidManager = asteroidManager; this.direction = direction; cachedTransform.position = position; customParticleEmitter = new CustomParticleEmitter(); warper = new Warper(cachedTransform); initParams(); }
public static void Postfix(Pickupable pickupable) { if (pickupable.GetTechType() == TechType.Warper) { Warper warper = pickupable.GetComponent <Warper>(); if (warper != null && warper.spawner != null) { warper.spawner.warper = null; warper.spawner.OnWarpOut(); warper.spawner = null; } } }
public void init(Transform target, Vector3 position, Vector3 direction) { this.target = target; this.direction = direction; cachedTransform.position = position; customParticleEmitter = new CustomParticleEmitter(); warper = new Warper(cachedTransform); //Create the weapon controller weaponController = new GunController(this); }
public PlayerController(InputController playerInput, PlayerAnimator playerAnimator, Transform playerTransform) { this.inputController = playerInput; this.playerAnimator = playerAnimator; this.playerTransform = playerTransform; //Get the parameters from game config acceleration = GameParamConfig.instance.retrieveParamValue <float>(GameConfigParamIds.PlayerAcceleration); maxSpeed = GameParamConfig.instance.retrieveParamValue <float>(GameConfigParamIds.PlayerMaxSpeed); angularSpeed = GameParamConfig.instance.retrieveParamValue <float>(GameConfigParamIds.PlayerAngularSpeed); speed = Vector2.zero; //Create Warper warper = new Warper(playerTransform); }
//----------------------------------------------------------------------------------------------------------- bool CanPlayerMoveToPosition(Vector2 destination) { Collider2D collision = Physics2D.OverlapPoint(destination); if (collision) { switch (LayerMask.LayerToName(collision.gameObject.layer)) { case "Wall": return(false); case "Grass": { m_movedOnGrass = true; return(true); } case "Door": return(false); case "Water": return(false); case "Sign": return(false); case "Warper": { playerActionComp.m_playerBlocked = true; Warper warper = collision.gameObject.GetComponent <Warper> (); StartCoroutine(warper.TeleportToNewPos((x) => pos = x)); return(false); } default: break; } } return(true); }
void InitFindPlayerPoint() { FFileName = Application.StartupPath + "\\test.ini"; int rv = ReadInt("TestSec", "GrayVal", -1); if (rv < 0 || rv > 255) { GrayThreshold = 125; WriteInt("TestSec", "GrayVal", GrayThreshold); } else { GrayThreshold = (byte)rv; } Width = XKOpenCGCamera.GetInstance().GetCGCameraWith(); Height = XKOpenCGCamera.GetInstance().GetCGCameraHeight(); lClientWidth = GetSystemMetrics(SM_CXSCREEN); lClientHeight = GetSystemMetrics(SM_CYSCREEN); m_curMousePoint = Point.Empty; m_curMousePoint.X = -1; m_curMousePoint.Y = -1; MinPoint = Point.Empty; MaxPoint = Point.Empty; unwantedPoint = new Point[XKOpenCGCamera.GetInstance().CGCameraBufLen]; m_warp = new Warper(); m_mode = MODE.MODE_MOTION; m_bCurPointModified = false; m_Rect = Rectangle.Empty; ResetRectify(); ResetSmoothing(); InitRectifyCfg(); m_bFirstInst = false; unwantedPointNum = 0; getFrameNum = 0; }
private void DrawHostilesMenu() { if (reaper == null) { if (GUILayout.Button("Spawn Reaper")) { GameObject prefabForTechType = CraftData.GetPrefabForTechType(TechType.ReaperLeviathan, true); GameObject gameObject = Utils.CreatePrefab(prefabForTechType); LargeWorldEntity.Register(gameObject); CrafterLogic.NotifyCraftEnd(gameObject, TechType.ReaperLeviathan); gameObject.SendMessage("StartConstruction", SendMessageOptions.DontRequireReceiver); reaper = gameObject.GetComponentInChildren <ReaperLeviathan>(); gameObject.transform.position += 50f * gameObject.transform.forward; } } else { GUILayout.Space(10); if (GUILayout.Button("Reaper Components")) { foreach (Component c in reaper.GetComponentsInChildren(typeof(Component))) { Log.Print("Component: " + c + " on go: " + c.gameObject.name); } } if (GUILayout.Button("Delete Reaper")) { Destroy(reaper.gameObject); } if (GUILayout.Button("AttackCyclops information")) { AttackCyclops ac = reaper.GetComponent <AttackCyclops>(); Log.Print("LastTarget: " + ac.lastTarget); Log.Print("aggressPerSecond: " + ac.aggressPerSecond); Log.Print("attackAggressionThreshold: " + ac.attackAggressionThreshold); Log.Print("attackPause: " + ac.attackPause); Log.Print("maxDistToLeash: " + ac.maxDistToLeash); Log.Print("swimVelocity: " + ac.swimVelocity); Log.Print("swimInterval: " + ac.swimInterval); Log.Print("aggressiveToNoise Falloff: " + ac.aggressiveToNoise.Falloff); Log.Print("aggressiveToNoise Value: " + ac.aggressiveToNoise.Value); } GUILayout.Space(10); } if (crabsquid == null) { if (GUILayout.Button("Spawn Crabsquid")) { GameObject prefabForTechType = CraftData.GetPrefabForTechType(TechType.CrabSquid, true); GameObject gameObject = Utils.CreatePrefab(prefabForTechType); LargeWorldEntity.Register(gameObject); CrafterLogic.NotifyCraftEnd(gameObject, TechType.CrabSquid); gameObject.SendMessage("StartConstruction", SendMessageOptions.DontRequireReceiver); crabsquid = gameObject.GetComponentInChildren <CrabSquid>(); gameObject.transform.position += 50f * gameObject.transform.forward; } } else { GUILayout.Space(10); if (GUILayout.Button("Crabsquid Components")) { foreach (Component c in crabsquid.GetComponentsInChildren(typeof(Component))) { Log.Print("Component: " + c + " on go: " + c.gameObject.name); } } if (GUILayout.Button("Delete Crabsquid")) { Destroy(crabsquid.gameObject); } GUILayout.Space(10); } if (ghostlevi == null) { if (GUILayout.Button("Spawn Ghost Levi")) { GameObject prefabForTechType = CraftData.GetPrefabForTechType(TechType.GhostLeviathan, true); GameObject gameObject = Utils.CreatePrefab(prefabForTechType); LargeWorldEntity.Register(gameObject); CrafterLogic.NotifyCraftEnd(gameObject, TechType.GhostLeviathan); gameObject.SendMessage("StartConstruction", SendMessageOptions.DontRequireReceiver); ghostlevi = gameObject.GetComponentInChildren <GhostLeviathan>(); gameObject.transform.position += 50f * gameObject.transform.forward; } } else { GUILayout.Space(10); if (GUILayout.Button("Ghost Levi Components")) { foreach (Component c in ghostlevi.GetComponentsInChildren(typeof(Component))) { Log.Print("Component: " + c + " on go: " + c.gameObject.name); } } if (GUILayout.Button("Delete Ghost Levi")) { Destroy(ghostlevi.gameObject); } GUILayout.Space(10); } if (seaDragon == null) { if (GUILayout.Button("Spawn Seadragon")) { GameObject prefabForTechType = CraftData.GetPrefabForTechType(TechType.SeaDragon, true); GameObject gameObject = Utils.CreatePrefab(prefabForTechType); LargeWorldEntity.Register(gameObject); CrafterLogic.NotifyCraftEnd(gameObject, TechType.SeaDragon); gameObject.SendMessage("StartConstruction", SendMessageOptions.DontRequireReceiver); seaDragon = gameObject.GetComponentInChildren <SeaDragon>(); gameObject.transform.position += 50f * gameObject.transform.forward; } } else { GUILayout.Space(10); if (GUILayout.Button("Seadragon Components")) { foreach (Component c in seaDragon.GetComponentsInChildren(typeof(Component))) { Log.Print("Component: " + c + " on go: " + c.gameObject.name); } } if (GUILayout.Button("Delete Seadragon")) { Destroy(seaDragon.gameObject); } GUILayout.Space(10); } if (warper == null) { if (GUILayout.Button("Spawn warper")) { GameObject prefabForTechType = CraftData.GetPrefabForTechType(TechType.Warper, true); GameObject gameObject = Utils.CreatePrefab(prefabForTechType); LargeWorldEntity.Register(gameObject); CrafterLogic.NotifyCraftEnd(gameObject, TechType.Warper); gameObject.SendMessage("StartConstruction", SendMessageOptions.DontRequireReceiver); warper = gameObject.GetComponentInChildren <Warper>(); gameObject.transform.position += 50f * gameObject.transform.forward; } } else { GUILayout.Space(10); if (GUILayout.Button("Warper Components")) { foreach (Component c in warper.GetComponentsInChildren(typeof(Component))) { Log.Print("Component: " + c + " on go: " + c.gameObject.name); } } if (GUILayout.Button("Delete Warper")) { Destroy(warper.gameObject); } GUILayout.Space(10); } }
private void DrawHostilesMenu() { if (reaper == null) { if (GUILayout.Button("Spawn Reaper")) { GameObject prefabForTechType = CraftData.GetPrefabForTechType(TechType.ReaperLeviathan, true); GameObject gameObject = Utils.CreatePrefab(prefabForTechType); LargeWorldEntity.Register(gameObject); CrafterLogic.NotifyCraftEnd(gameObject, TechType.ReaperLeviathan); gameObject.SendMessage("StartConstruction", SendMessageOptions.DontRequireReceiver); reaper = gameObject.GetComponentInChildren <ReaperLeviathan>(); gameObject.transform.position += 50f * gameObject.transform.forward; } } else { GUILayout.Space(10); if (GUILayout.Button("Reaper Components")) { foreach (Component c in reaper.GetComponentsInChildren(typeof(Component))) { Log.Print("Component: " + c + " on go: " + c.gameObject.name); } } if (GUILayout.Button("Delete Reaper")) { Destroy(reaper.gameObject); } GUILayout.Space(10); } if (crabsquid == null) { if (GUILayout.Button("Spawn Crabsquid")) { GameObject prefabForTechType = CraftData.GetPrefabForTechType(TechType.CrabSquid, true); GameObject gameObject = Utils.CreatePrefab(prefabForTechType); LargeWorldEntity.Register(gameObject); CrafterLogic.NotifyCraftEnd(gameObject, TechType.CrabSquid); gameObject.SendMessage("StartConstruction", SendMessageOptions.DontRequireReceiver); crabsquid = gameObject.GetComponentInChildren <CrabSquid>(); gameObject.transform.position += 50f * gameObject.transform.forward; } } else { GUILayout.Space(10); if (GUILayout.Button("Crabsquid Components")) { foreach (Component c in crabsquid.GetComponentsInChildren(typeof(Component))) { Log.Print("Component: " + c + " on go: " + c.gameObject.name); } } if (GUILayout.Button("Delete Crabsquid")) { Destroy(crabsquid.gameObject); } GUILayout.Space(10); } if (ghostlevi == null) { if (GUILayout.Button("Spawn Ghost Levi")) { GameObject prefabForTechType = CraftData.GetPrefabForTechType(TechType.GhostLeviathan, true); GameObject gameObject = Utils.CreatePrefab(prefabForTechType); LargeWorldEntity.Register(gameObject); CrafterLogic.NotifyCraftEnd(gameObject, TechType.GhostLeviathan); gameObject.SendMessage("StartConstruction", SendMessageOptions.DontRequireReceiver); ghostlevi = gameObject.GetComponentInChildren <GhostLeviathan>(); gameObject.transform.position += 50f * gameObject.transform.forward; } } else { GUILayout.Space(10); if (GUILayout.Button("Ghost Levi Components")) { foreach (Component c in ghostlevi.GetComponentsInChildren(typeof(Component))) { Log.Print("Component: " + c + " on go: " + c.gameObject.name); } } if (GUILayout.Button("Delete Ghost Levi")) { Destroy(ghostlevi.gameObject); } GUILayout.Space(10); } if (seaDragon == null) { if (GUILayout.Button("Spawn Seadragon")) { GameObject prefabForTechType = CraftData.GetPrefabForTechType(TechType.SeaDragon, true); GameObject gameObject = Utils.CreatePrefab(prefabForTechType); LargeWorldEntity.Register(gameObject); CrafterLogic.NotifyCraftEnd(gameObject, TechType.SeaDragon); gameObject.SendMessage("StartConstruction", SendMessageOptions.DontRequireReceiver); seaDragon = gameObject.GetComponentInChildren <SeaDragon>(); gameObject.transform.position += 50f * gameObject.transform.forward; } } else { GUILayout.Space(10); if (GUILayout.Button("Seadragon Components")) { foreach (Component c in seaDragon.GetComponentsInChildren(typeof(Component))) { Log.Print("Component: " + c + " on go: " + c.gameObject.name); } } if (GUILayout.Button("Delete Seadragon")) { Destroy(seaDragon.gameObject); } GUILayout.Space(10); } if (warper == null) { if (GUILayout.Button("Spawn warper")) { GameObject prefabForTechType = CraftData.GetPrefabForTechType(TechType.Warper, true); GameObject gameObject = Utils.CreatePrefab(prefabForTechType); LargeWorldEntity.Register(gameObject); CrafterLogic.NotifyCraftEnd(gameObject, TechType.Warper); gameObject.SendMessage("StartConstruction", SendMessageOptions.DontRequireReceiver); warper = gameObject.GetComponentInChildren <Warper>(); gameObject.transform.position += 50f * gameObject.transform.forward; } } else { GUILayout.Space(10); if (GUILayout.Button("Warper Components")) { foreach (Component c in warper.GetComponentsInChildren(typeof(Component))) { Log.Print("Component: " + c + " on go: " + c.gameObject.name); } } if (GUILayout.Button("Delete Warper")) { Destroy(warper.gameObject); } GUILayout.Space(10); } }
void Stop() { Warper.Finalization(); }
void Start() { Warper.Initialize(); }
private void Awake() { this.warper = transform.root.GetComponent <Warper>(); this.warpelEm = warpel.emission; this.warpTrailEm = warpTrail.emission; }
public static void Prefix(Warper __instance) { __instance.WarpOut(); }
public static void Initialize(TestContext context) { Warper.Initialize(); }
public static void Cleanup() { Warper.Finalization(); }
public void DoNothingTest() { Warper.DoNothing(); Assert.IsTrue(true); }
public void SizeofColorExportNewSampleReceivedDataPtrTest() { int size = Warper.SizeofStruct("ColorExport::NewSampleReceivedData"); Assert.AreEqual(Marshal.SizeOf(typeof(ColorExport.NewSampleReceivedDataPtr)), size); }
public void SizeofDepthSenseUVTest() { int size = Warper.SizeofStruct("DepthSense::UV"); Assert.AreEqual(Marshal.SizeOf(typeof(UV)), size); }
public void SizeofDepthSenseFPVertexTest() { int size = Warper.SizeofStruct("DepthSense::FPVertex"); Assert.AreEqual(Marshal.SizeOf(typeof(FPVertex)), size); }