public bool pressing = false; // Variable to see if the player is pressing a button void Start() { player = GetComponent <CharacterController>(); // Find the player's character controller followObj = GameObject.Find("FollowingSpawn"); // Find the object to follow pSwitch = GameObject.Find("PlayerPlace").GetComponent <PlayerSwitch>(); // Find the PlayerSwitch game object to find the PlayerSwitch.cs script }
void Start() { spirit = GameObject.Find("Spirit"); player = GameObject.Find("Player"); pSwitch = player.GetComponent<PlayerSwitch>(); refPos = this.transform.position; zPos = refPos.z; }
void Awake() { playerSwitch = GameObject.FindObjectOfType<PlayerSwitch>(); ActionHandler actionHandler = GetComponent<ActionHandler>(); player = playerSwitch.gameObject.transform; spirit = Transform.FindObjectOfType<SpiritMovement>().gameObject.transform; actionHandler.TakeAction += ToSpirit; }
void Start() { playerSwitch = GameObject.FindObjectOfType<PlayerSwitch>(); light = this.GetComponent<Light>(); startIntens = light.intensity; fadedIn = true; StartCoroutine("FadeOut"); }
// Use this for initialization void Start() { ElementType = "Water"; spawnArea = transform.Find("WaterSpawn"); water = Resources.Load("Water") as GameObject; playerSwitch = GameObject.Find("PlayerPlace").GetComponent <PlayerSwitch> (); Damage = 70; }
// Use this for initialization void Start() { ElementType = "Fire"; spawnPoint = transform.Find("FireSpawn"); fire = Resources.Load("Fire") as GameObject; Damage = 70; playerSwitch = GameObject.Find("PlayerPlace").GetComponent <PlayerSwitch> (); }
// Use this for initialization void Start() { ElementType = "Air"; spawnArea = transform.Find("AirSpawn"); air = Resources.Load("Air") as GameObject; playerSwitch = GameObject.Find("PlayerPlace").GetComponent <PlayerSwitch> (); Damage = 80; energyVal = 0.4f; }
void Start() { playerSwitch = GameObject.FindObjectOfType<PlayerSwitch>(); startColor = this.GetComponent<Renderer>().material.color; fadedIn =true; if(disableInHuman) { this.GetComponent<Renderer>().material.color = new Color(startColor.r, startColor.g, startColor.b, 0); } }
// Use this for initialization void Start() { mainPlayer = GameObject.Find("PlayerPlace"); playerSwitch = mainPlayer.GetComponent <PlayerSwitch> (); fireMsg = "Fire Wizard: Please don't kill me, let me join you! I can melt down ice blocks that are blocking the way!"; waterMsg = "Water Wizard: Spare me good sir, I wish to join you. If you need to get across a trench, I'll fill it with water."; airMsg = "Air Wizard: Killing me would be a mistake. I predict you'll need me to push away heavy boulders."; gameObject.SetActive(false); }
// public ActionHandler actionHandler; void Awake() { // onOff = true; pSwitch = GameObject.FindObjectOfType<PlayerSwitch>(); gameObject.transform.position = moveStartPos; actionHandler = GetComponent<ActionHandler>(); if(actionHandler) { actionHandler.TakeAction += TransformPositionT; } // actionHandler = GetComponent<ActionHandler>(); }
// Start is called before the first frame update void Start() { rb = GetComponent <Rigidbody2D>(); jumpsLeft = possibleJumps; crafting = GetComponent <Crafting>(); inv = GetComponent <Inventory>(); vit = GetComponent <Vitality>(); triggerTouch = GetComponent <TriggerTouch>(); playerSwitch = GameObject.FindGameObjectWithTag(playerSwitchScriptTag).GetComponent <PlayerSwitch>(); levelManager = GameObject.FindGameObjectWithTag("LevelManager").GetComponent <LevelManager>(); }
private void Awake() { playerSwitch = GetComponent <PlayerSwitch>(); playerController = GetComponent <PlayerController>(); playerShooting = GetComponent <PlayerShooting>(); currentHealth = startingHealth; anim = GetComponentInChildren <Animator>(); //playerAudio = GetComponent<AudioSource>(); uIManager = FindObjectOfType <UIManager>(); audioSource = GetComponentInChildren <AudioSource>(); }
private void Update() { _remainingTime -= Time.deltaTime; if (!_levelWon) { UpdateTimerText(); } if (!(_remainingTime < 0)) { return; } PlayerSwitch.SwitchPlayers(); _remainingTime = TIME_TO_CHANGE; }
private void OnCollisionEnter(Collision other) { if (other.gameObject.CompareTag("Player")) { _playerMeshRenderer.material = _purpleVisible; gameObject.GetComponent <TrailRenderer>().material = _purpleVisible; gameObject.GetComponent <ParticleSystemRenderer>().material = _purpleVisible; _paintedObjectTag = "Purple"; PlayerSwitch.WinLevel(); } else if (!other.gameObject.CompareTag("Unpaintable") && !other.gameObject.CompareTag(_paintedObjectTag)) { _playerParticleSystem.Play(); other.gameObject.GetComponent <MeshRenderer>().material = _playerMeshRenderer.material; other.gameObject.tag = _paintedObjectTag; } }
public void StopRC(bool instant = false) { if (IsRemoteControlled) { IsRemoteControlled = false; if (OriginalPed == null) { return; } OriginalPed.Task.ClearAll(); PlayerSwitch.Switch(OriginalPed, true, instant); if (!instant) { rcOff.Play(); } if (rcSomeSerious.IsAnyInstancePlaying) { rcSomeSerious?.Stop(); } if (_forcedHandbrake) { SetForcedHandbrake(); } Vehicle.LockStatus = VehicleLockStatus.None; Function.Call(Hash.CLEAR_FOCUS); _blip?.Delete(); _camera?.Delete(); _camera = null; World.RenderingCamera = null; } }
public void StartRC() { if (Vehicle == null) { return; } IsRemoteControlled = true; Vehicle.LockStatus = VehicleLockStatus.StickPlayerInside; Clone = PlayerSwitch.CreatePedAndSwitch(out OriginalPed, Main.PlayerPed.Position, Main.PlayerPed.Heading, true); Clone.SetIntoVehicle(Vehicle, VehicleSeat.Driver); Clone.CanFlyThroughWindscreen = false; Clone.CanBeDraggedOutOfVehicle = false; Clone.BlockPermanentEvents = true; Clone.AlwaysKeepTask = true; Clone.IsVisible = false; _blip = OriginalPed.AddBlip(); _blip.Sprite = (BlipSprite)480; _blip.Color = BlipColor.White; foreach (var sound in _rcSounds) { sound.SourceEntity = OriginalPed; } rcOn.Play(); OriginalPed.Task.TurnTo(Vehicle); if (CurrentMode == RcModes.FromPlayerCamera) { _camera = World.CreateCamera(GameplayCamera.Position, GameplayCamera.Rotation, GameplayCamera.FieldOfView); _camera.PointAt(Vehicle); World.RenderingCamera = _camera; } }
public GameControl(Player player1, Player player2) { this.playerSwitch = new PlayerSwitch(player1, player2); }
void Start() { fadeBlack = GameObject.Find ("BlackFade"); anim = GetComponentInChildren<Animator>(); charGfx = anim.gameObject.transform; sMove = GameObject.FindObjectOfType<SpiritMovement>(); pMove = GetComponent<PlayerMovement>(); pSwitch = GetComponent<PlayerSwitch>(); actionHandler = GetComponent<ActionHandler>(); if(actionHandler) { actionHandler.TakeAction += End; } // StartCoroutine("EndCR"); }
void Awake() { playerSwitch = GameObject.FindObjectOfType<PlayerSwitch>(); ActionHandler actionHandler = GetComponent<ActionHandler>(); actionHandler.TakeAction += OutSpirit; }
void Start() { pS = GameObject.Find("Player").GetComponent<PlayerSwitch>(); foreach(GameObject g in attatchedObjs) { if(g.GetComponent<ActionHandler>()) { // if(actionDoers.Contains(g.GetComponent<ActionHandler>())) // { actionDoers.Add(g.GetComponent<ActionHandler>()); // } } } // actionDo = attatchedObj.GetComponent<ActionDoer>(); }
void Start() { playerSwitch = PlayerSwitch.instance; mc = MC.instance.gameObject.GetComponent <PlayerController>(); npc = NPC.instance.gameObject.GetComponent <PlayerController>(); }
void Start() { pSwitch = GameObject.FindObjectOfType<PlayerSwitch>(); player = pSwitch.gameObject.transform; activeMovement = true; rightRot = Quaternion.Euler(0,-90,0); leftRot = Quaternion.Euler(0,90,0); jumpSlow = movementMax; moveMaxStart = movementMax; gravity = gravityForce; spiritGfx = transform.GetChild(0); Debug.Log ("GSG"); }
void Start() { pSwitch = GameObject.FindObjectOfType<PlayerSwitch>(); startColor = GetComponent<Renderer>().material.color; noAlphaColor = new Color (GetComponent<Renderer>().material.color.r, GetComponent<Renderer>().material.color.g, GetComponent<Renderer>().material.color.b, 0); startScale = transform.localScale; player = GameObject.Find("Player").transform; spirit = GameObject.Find("Spirit").transform; if(outerCircle) { StartCoroutine(Scale ()); } if(!dontFade) { StartCoroutine(DistanceCheck()); } }
// Use this for initialization // private List<GameObject> children; // private int i = 0; void Start() { // foreach( GameObject gObj in transform) // { // children[i] = gObj; // i++; // } startColor = this.GetComponent<Renderer>().material.GetColor("_TintColor"); sMove = GameObject.Find("Spirit").GetComponent<SpiritMovement>(); playerSwitch = GameObject.FindObjectOfType<PlayerSwitch>(); if(!sMove.grounded) { StartCoroutine("FadeOut"); fadedIn = true; } this.GetComponent<Renderer>().material.SetColor("_TintColor", new Color(startColor.r, startColor.g, startColor.b, 0)); }
void Start() { waterSound = GameObject.Find("WaterSound").GetComponent<AudioSource>(); waterSound.enabled = false; vig = Camera.main.GetComponent<Vignetting>(); spirit = Transform.FindObjectOfType<SpiritMovement>().gameObject.transform; anim = GetComponentInChildren<Animator>(); charGfx = anim.gameObject.transform; pMotor = GetComponent<CharacterMotor>(); pMove = GetComponent<PlayerMovement>(); startFallspeed = pMotor.movement.maxFallSpeed; pSwitch = GetComponent<PlayerSwitch>(); actionHandler = GetComponent<ActionHandler>(); if(actionHandler) { actionHandler.TakeAction += Floater; } sceneFade = Camera.main.GetComponent<SceneFade>(); leftCol.GetComponent<Collider>().enabled=false; }
void Start() { canSprint = false; foreach (AudioListener o in FindObjectsOfType<AudioListener>()) Debug.Log(o.name, o); whiteFade = GameObject.Find("WhiteFade"); pSwitch = GameObject.FindObjectOfType<PlayerSwitch>(); // inStorm = true; if(startSitting) { sitting = true; } if(startSittingHouse) { sittingHouse = true; } floatC = GetComponent<FloatChar>(); charAnim = GetComponentInChildren<Animator>(); charGfx = transform.GetChild(0); activeMovement = true; motor = GetComponent<CharacterMotor>(); snowPF = GetComponentInChildren<ParticleSystem>(); snowPF.enableEmission = false; snowAtFeet = false; if(pSwitch.canGoSpirit) { StartCoroutine("StepUpdate"); } }
// Use this for initialization void Start() { playerSwitch = FindObjectOfType <PlayerSwitch>(); moveAndShoot = FindObjectOfType <MoveAndShoot>(); }