コード例 #1
0
    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
    }
コード例 #2
0
ファイル: TargetFollow.cs プロジェクト: CaptainKirby/Surtr
 void Start()
 {
     spirit = GameObject.Find("Spirit");
     player = GameObject.Find("Player");
     pSwitch = player.GetComponent<PlayerSwitch>();
     refPos = this.transform.position;
     zPos = refPos.z;
 }
コード例 #3
0
ファイル: HumanToSpirit.cs プロジェクト: CaptainKirby/Surtr
 void Awake()
 {
     playerSwitch = GameObject.FindObjectOfType<PlayerSwitch>();
     ActionHandler actionHandler =  GetComponent<ActionHandler>();
     player = playerSwitch.gameObject.transform;
     spirit = Transform.FindObjectOfType<SpiritMovement>().gameObject.transform;
     actionHandler.TakeAction += ToSpirit;
 }
コード例 #4
0
ファイル: LightFadeout.cs プロジェクト: CaptainKirby/Surtr
 void Start()
 {
     playerSwitch = GameObject.FindObjectOfType<PlayerSwitch>();
     light = this.GetComponent<Light>();
     startIntens = light.intensity;
     fadedIn =	true;
     StartCoroutine("FadeOut");
 }
コード例 #5
0
 // 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;
 }
コード例 #6
0
 // 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> ();
 }
コード例 #7
0
ファイル: AirPlayer.cs プロジェクト: johannyu/The-Dungeon
 // 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;
 }
コード例 #8
0
ファイル: SpiritActivate.cs プロジェクト: CaptainKirby/Surtr
 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);
     }
 }
コード例 #9
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);
    }
コード例 #10
0
ファイル: Move.cs プロジェクト: CaptainKirby/Surtr
 //    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>();
 }
コード例 #11
0
    // 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>();
    }
コード例 #12
0
    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>();
    }
コード例 #13
0
    private void Update()
    {
        _remainingTime -= Time.deltaTime;

        if (!_levelWon)
        {
            UpdateTimerText();
        }

        if (!(_remainingTime < 0))
        {
            return;
        }

        PlayerSwitch.SwitchPlayers();
        _remainingTime = TIME_TO_CHANGE;
    }
コード例 #14
0
ファイル: CollisionSystem.cs プロジェクト: lucassfelix/Purple
 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;
     }
 }
コード例 #15
0
        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;
            }
        }
コード例 #16
0
        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;
            }
        }
コード例 #17
0
 public GameControl(Player player1, Player player2)
 {
     this.playerSwitch = new PlayerSwitch(player1, player2);
 }
コード例 #18
0
ファイル: EndThroughDoor.cs プロジェクト: CaptainKirby/Surtr
 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");
 }
コード例 #19
0
ファイル: OutOfSpirit.cs プロジェクト: CaptainKirby/Surtr
 void Awake()
 {
     playerSwitch = GameObject.FindObjectOfType<PlayerSwitch>();
     ActionHandler actionHandler =  GetComponent<ActionHandler>();
     actionHandler.TakeAction += OutSpirit;
 }
コード例 #20
0
ファイル: InputTaker.cs プロジェクト: CaptainKirby/Surtr
    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>();
    }
コード例 #21
0
 void Start()
 {
     playerSwitch = PlayerSwitch.instance;
     mc           = MC.instance.gameObject.GetComponent <PlayerController>();
     npc          = NPC.instance.gameObject.GetComponent <PlayerController>();
 }
コード例 #22
0
ファイル: SpiritMovement.cs プロジェクト: CaptainKirby/Surtr
 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");
 }
コード例 #23
0
ファイル: InteractCircle.cs プロジェクト: CaptainKirby/Surtr
    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());
        }
    }
コード例 #24
0
ファイル: SwirlFade.cs プロジェクト: CaptainKirby/Surtr
    // 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));
    }
コード例 #25
0
ファイル: FloatChar.cs プロジェクト: CaptainKirby/Surtr
    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;
    }
コード例 #26
0
ファイル: PlayerMovement.cs プロジェクト: CaptainKirby/Surtr
    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");
        }
    }
コード例 #27
0
 // Use this for initialization
 void Start()
 {
     playerSwitch = FindObjectOfType <PlayerSwitch>();
     moveAndShoot = FindObjectOfType <MoveAndShoot>();
 }