void Start() { _isoRigidbody = GetComponent <IsoRigidbody>(); if (!_isoRigidbody) { throw new UnityException("PlayerController. IsoRigidbody component not found!"); } }
public IsoRaycastHit(IsoCollider collider, float distance, Vector3 normal, Vector3 point, IsoRigidbody isoRigidbody, IsoTransform isoTransform) { Collider = collider; Distance = distance; Normal = normal; Point = point; IsoRigidbody = isoRigidbody; IsoTransform = isoTransform; }
void Start() { _isoObject = GetComponent<IsoObject>(); if ( !_isoObject ) { throw new UnityException("AlienBallController. IsoObject component not found!"); } _isoRigidbody = GetComponent<IsoRigidbody>(); if ( !_isoRigidbody ) { throw new UnityException("AlienBallController. IsoRigidbody component not found!"); } StartCoroutine("AddRndForce"); }
void Update() { iso_rigidyBody = GetComponent <IsoRigidbody>(); if (Input.GetKey(KeyCode.R)) { iso_object.position += Vector3.one; Debug.Log("VAlor da gravidade = " + iso_rigidyBody.useGravity); Debug.Log("VAlor de isoWorld = " + iso_object.isoWorld._tileSize); } }
void Start() { if (!sprite) { throw new UnityException("PlayerController. Sprite not found!"); } _isoObject = GetComponent <IsoObject>(); if (!_isoObject) { throw new UnityException("PlayerController. IsoObject component not found!"); } _isoRigidbody = GetComponent <IsoRigidbody>(); if (!_isoRigidbody) { throw new UnityException("PlayerController. IsoRigidbody component not found!"); } }
void Start() { IsNear = false; move = false; canStart = true; npc_start = true; MoveTiming = true; NPCCharacter = GetComponent<NPCBase>(); seekerIso = GetComponent<IsoObject>(); seekerRigidybody = GetComponent<IsoRigidbody>(); cachedSeekerPos = seekerIso.position; cachedTargetPos = _targetPos.GetComponent<IsoObject>().position; _targetIsoObject = _targetPos.GetComponent<IsoObject>(); world = GameObject.Find("Camera").GetComponent<IsoWorld>(); }
void Awake() { _isoTransform = this.GetOrAddComponent <IsoTransform>(); //better than requirecomponent this.GetOrAddComponent <IsoCollider>(); _isoRigidbody = this.GetOrAddComponent <IsoRigidbody>(); }
void OnEnable() { instance = target as IsoRigidbody; instance_Fields = ExposeProperties.GetProperties(instance); }
void MainController() { if (isPlayingAnimation) { animator.speed = 1; } iso_rigidyBody = gameObject.GetComponent <IsoRigidbody>(); if (iso_rigidyBody) { if (Input.GetKey(KeyCode.LeftArrow) || Input.GetKey(KeyCode.A) || Caapora.instance.moveDirection == "left") { lookingAt = "left"; Caapora.instance.moveLeft(); } else if (Input.GetKey(KeyCode.RightArrow) || Input.GetKey(KeyCode.D) || Caapora.instance.moveDirection == "right") { lookingAt = "right"; Caapora.instance.moveRight(); } else if (Input.GetKey(KeyCode.DownArrow) || Input.GetKey(KeyCode.S) || Caapora.instance.moveDirection == "down") { lookingAt = "down"; Caapora.instance.moveDown(); } else if (Input.GetKey(KeyCode.UpArrow) || Input.GetKey(KeyCode.W) || Caapora.instance.moveDirection == "up") { lookingAt = "up"; Caapora.instance.moveUp(); } else if (Input.GetKeyDown(KeyCode.UpArrow) && Input.GetKeyDown(KeyCode.LeftArrow) || Caapora.instance.moveDirection == "up") { lookingAt = "up"; Caapora.instance.moveUpLeft(); } else if (Input.GetKeyDown(KeyCode.B) || _BKey) { Caapora.instance.ThrowWater(); } else { Caapora.instance.animator.SetTrigger("Idle"); } if (Input.GetKeyDown(KeyCode.Z) || _ZKey) { GameManager.instance.MapZoomOut(); } if (Input.GetKeyUp(KeyCode.Z)) { GameManager.instance.MapZoomIn(); } if (Input.GetKeyDown(KeyCode.X) || _JKey) { JClick = false; StartRun(); } if (Input.GetKeyDown(KeyCode.Space)) { Caapora.instance.Jump(); GameManager.instance.Pause(); } } }
public IsoFakeRigidbody Init(IsoRigidbody iso_rigidbody) { _isoRigidbody = iso_rigidbody; return(this); }
public IEnumerator launchOject(string type, float distance) { GameObject objeto; switch (type) { case "Water": objeto = Instantiate(Resources.Load("Prefabs/splashWaterPrefab")) as GameObject; break; case "Bucket": GameObject baldeTmp = Inventory.getItem(); baldeTmp.GetComponent <Balde>().Active(); objeto = baldeTmp; break; default: objeto = Instantiate(Resources.Load("Prefabs/splashWaterPrefab")) as GameObject; break; } var playerCurPosition = GetComponent <IsoObject>().position; var balde = Inventory.getItem().GetComponent <Balde>(); IsoRigidbody objRb = objeto.GetComponent <IsoRigidbody>(); IsoObject obj = objeto.GetComponent <IsoObject>(); objRb.mass = 0.1f; if (InputController.instance.lookingAt == "right") { obj.position = playerCurPosition + (Vector3.right + Vector3.down) / 3; objRb.velocity = (Vector3.right + Vector3.down) * 3; balde.UseWalter(); } if (InputController.instance.lookingAt == "left") { obj.position = playerCurPosition + (Vector3.left + Vector3.up) / 3; objRb.velocity = (Vector3.left + Vector3.up) * 3; balde.UseWalter(); } if (InputController.instance.lookingAt == "up") { obj.position = playerCurPosition + (Vector3.up + Vector3.right) / 3; objRb.velocity = (Vector3.up + Vector3.right) * 3; balde.UseWalter(); } if (InputController.instance.lookingAt == "down") { obj.position = playerCurPosition + (Vector3.down + Vector3.left) / 3; objRb.velocity = (Vector3.down + Vector3.left) * 3; balde.UseWalter(); } yield return(new WaitForSeconds(0.5f)); _canLauchWater = true; }
void Start() { demage = 10f; fire = gameObject.GetComponent <IsoRigidbody>(); }
public void Init(IsoRigidbody iso_rigidbody) { _isoRigidbody = iso_rigidbody; }