void OnMouseDown() { //this tappedRedArrowCounter is for the tutorial tapRedArrowCounter++; activeMainPlayerOBJ = GameObject.FindGameObjectWithTag("ActiveMain"); activeMainPlayerScript = activeMainPlayerOBJ.GetComponent <MainChar>(); QueueScript1 qScript = activeMainPlayerOBJ.GetComponentInChildren <QueueScript1>(); if (qScript.myItemObjects.Count > 0) { activeMainPlayerScript.setMainTarget(activeMainPlayerScript.getTargetUnderConsideration()); activeMainPlayerScript.getTargetUnderConsideration().setAssailant(activeMainPlayerScript); activeMainPlayerScript.setAttacking(true); activeMainPlayerScript.myArrow.SetActive(false); //uncomment the code below to hide all character queues when character first starts moving /*activeMainPlayerScript.myQueueOBJ.SetActive(false); * foreach(Character chr in levelManScript.charsInLevel){ * chr.myQueueOBJ.SetActive(false); * }*/ levelManScript.setGameState(GAME_STATE.CHAIN_REACTION); levelManScript.enableAllInventoryColliders(false); // } }
void Start() { instace = this; dashT = dashDur + 1; tmpSpd = spd; }
void Start() { story = FindObjectOfType <InkStory>(); mode = GameMode.dialogue; main = FindObjectOfType <MainChar>(); gs = FindObjectOfType <GameState>(); main.SetAcceleration(2.0f, MainChar.movement.go); }
public bool OnMouseDown(){ if (levelManScript.getGameState() == GAME_STATE.NONE) { myQueueOBJ.SetActive (true); } else if (levelManScript.getGameState() == GAME_STATE.RED_ARROW_OUT) { activeMainPlayerOBJ = GameObject.FindGameObjectWithTag ("ActiveMain"); activeMainPlayerScript = activeMainPlayerOBJ.GetComponent <MainChar>(); activeMainPlayerScript.rotateArrow (this); activeMainPlayerScript.setTargetUnderConsideration(this); } return true; }
public float dashC; //Cooldown para volver a dashear void Start() { isUp = false; //transform.position = Save.lastCheckPoint; instace = this; anim = this.GetComponent <Animator>(); rb = this.GetComponent <Rigidbody2D>(); rb.constraints = RigidbodyConstraints2D.FreezeRotation; transform.gameObject.tag = "detectable"; //Importante que el tag sea detectable para que los monstruos sigan a Lucy vel = velocidad; dashT = dashDur + 1; }
private void ChooseStartingLocation() { Vector2 pos = MainHatch.transform.position; float randomAngle = UnityEngine.Random.value * Mathf.PI * 2f; Vector2 randomPos = new Vector2(Mathf.Sin(randomAngle), Mathf.Cos(randomAngle)); randomPos *= UnityEngine.Random.value * 50f + 100f; if (MainChar != null) { MainChar.Teleport(pos + randomPos); } }
public Game(MainChar m) { pm = new PhysicsManager(this); renderman = new RenderManager(); entities = //new AdvancedEntityManager(128,64,32,16,8,4,2,1,0.5); new AdvancedEntityManager(pm, renderman, 128, 64, 32, 16, 8, 4, 2, 1, 0.5); events = new GameEventManager(this, 1000, 100, 10, 1); mainChar = m; //entities = new ListEntityManager(); gameTimer = new BulletHell.Time.Timer(); curTimeRate = 1; timeRateFunc = new PolyFunc <double, double>(curTimeRate); timeFunc = timeRateFunc.FI; Add(m); }
public bool OnMouseDown() { if (levelManScript.getGameState() == GAME_STATE.NONE) { myQueueOBJ.SetActive(true); } else if (levelManScript.getGameState() == GAME_STATE.RED_ARROW_OUT) { activeMainPlayerOBJ = GameObject.FindGameObjectWithTag("ActiveMain"); activeMainPlayerScript = activeMainPlayerOBJ.GetComponent <MainChar>(); activeMainPlayerScript.rotateArrow(this); activeMainPlayerScript.setTargetUnderConsideration(this); } return(true); }
//主角 void CreateMainChar() { GameObject mainCharObj = new GameObject(); mainCharObj.name = "@MainChar"; mainCharObj.transform.parent = this.transform; mainCharObj.transform.position = birthPosTran.position; mainCharObj.transform.rotation = Quaternion.identity; CharacterController charController = mainCharObj.AddComponent <CharacterController> (); charController.radius = 0.35f; charController.height = 1.65f; charController.skinWidth = 0.01f; charController.slopeLimit = 20.0f; charController.center = new Vector3(0, 0.825f, 0); mainChar = mainCharObj.AddComponent <MainChar> (); }
public void load() { story = FindObjectOfType <InkStory>(); mode = GameMode.dialogue; main = FindObjectOfType <MainChar>(); Debug.Log(main.maxSpeed); Vector3 pos = gs.loadPosition(type); if (pos != new Vector3(0f, 0f)) { Debug.Log("Loaded:"); Debug.Log(pos); main.transform.position = pos; Debug.Log(main.maxSpeed); } if (!story.CanContinue()) { Debug.Log(!story.CanContinue()); ContinueTraveling(); } }
void OnMouseDown(){ //this tappedRedArrowCounter is for the tutorial tapRedArrowCounter++; activeMainPlayerOBJ = GameObject.FindGameObjectWithTag ("ActiveMain"); activeMainPlayerScript = activeMainPlayerOBJ.GetComponent <MainChar>(); QueueScript1 qScript = activeMainPlayerOBJ.GetComponentInChildren<QueueScript1>(); if(qScript.myItemObjects.Count > 0){ activeMainPlayerScript.setMainTarget (activeMainPlayerScript.getTargetUnderConsideration()); activeMainPlayerScript.getTargetUnderConsideration().setAssailant(activeMainPlayerScript); activeMainPlayerScript.setAttacking(true); activeMainPlayerScript.myArrow.SetActive(false); //uncomment the code below to hide all character queues when character first starts moving /*activeMainPlayerScript.myQueueOBJ.SetActive(false); foreach(Character chr in levelManScript.charsInLevel){ chr.myQueueOBJ.SetActive(false); }*/ levelManScript.setGameState(GAME_STATE.CHAIN_REACTION); levelManScript.enableAllInventoryColliders(false); // } }
public void TakeItem(Item.Type type, int amount) => MainChar.TakeItem(type, amount);