コード例 #1
0
ファイル: Tornado.cs プロジェクト: JayTrask/WizardSoccer
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag != "Wind")
     {
         WindForce tempWindForce = other.gameObject.AddComponent <WindForce>();
         tempWindForce.setForce(windDirection);
     }
 }
コード例 #2
0
    private void Start()
    {
        _force = GameObject.FindObjectOfType <WindForce>();
        _storm = GameObject.FindObjectOfType <Storm>();

        _rayStartingPoint = Vector3.zero;

        StormCenterPosition = Vector3.zero;

        smoothStepTime = new[] { 1f, 1f, 1f };

        Invoke(nameof(_setWindDirectionAndInvokeSmall), 1.0f);
        Invoke(nameof(_setWindDirectionAndInvokeMedium), 1.0f);
        Invoke(nameof(_setWindDirectionAndInvokeBig), 1.0f); //Sped up setting used for debugging
        //Invoke(nameof(_setWindDirectionAndInvokeBig), 20.0f); //Original setting
    }
コード例 #3
0
    protected virtual void Start()
    {
        Mass = 1.0f;

        //Set the needed variables in the inheriting classes. E.g. set the mass for the player.
        Construct();

        //Construct an IdleState
        SetState();
        state.Construct();

        anim = GetComponent <Animator>();

        //Find the storm objects
        storm     = GameObject.FindObjectOfType <Storm>();
        force     = GameObject.FindObjectOfType <WindForce>();
        direction = GameObject.FindObjectOfType <WindDirection>();
    }
コード例 #4
0
    private void Start()
    {
        coll = GetComponent <BoxCollider>();

        particleSystems = GetComponentsInChildren <ParticleSystem>();

        psMain     = new ParticleSystem.MainModule[particleSystems.Length];
        psShape    = new ParticleSystem.ShapeModule[particleSystems.Length];
        psEmission = new ParticleSystem.EmissionModule[particleSystems.Length];

        for (int i = 0; i < particleSystems.Length; i++)
        {
            psMain[i]     = particleSystems[i].main;
            psShape[i]    = particleSystems[i].shape;
            psEmission[i] = particleSystems[i].emission;
        }

        windForce = GetComponent <WindForce>();
    }
コード例 #5
0
    private void Start()
    {
        _windCenter    = GameObject.FindGameObjectWithTag("WindCenter");
        _storm         = _windCenter.GetComponent <Storm>();
        _windDirection = _storm.GetComponent <WindDirection>();
        _windForce     = _storm.GetComponent <WindForce>();
        _stormCloud    = _storm.stormCloud;

        _player    = GameObject.FindGameObjectWithTag("Player");
        _baseMotor = _player.GetComponent <BaseMotor>();

        _inGameMenu = GameObject.FindGameObjectWithTag("GameUI").GetComponent <InGameMenu>();

        _findIslandOrigins();
        _setUpPortals();
        _inGameMenu.UpdateText();

        Invoke(nameof(_activateCurrentPortal), countdownTilPortalActive);
    }
コード例 #6
0
 private void Awake()
 {
     _direction = gameObject.AddComponent <WindDirection>();
     _force     = gameObject.AddComponent <WindForce>();
 }
コード例 #7
0
    public VehicleModel()
    {
        VehicleOverview = new VehicleOverview();
        engine          = new Engine();
        starter         = new Starter();
        gearBox         = new GearBox();
        vehGearNum      = 0;
        for (int i = 0; i < subGears.Length; i++)
        {
            subGears[i] = new SubGear();
        }
        windForce      = new WindForce();
        steeringFactor = new SteeringFactor();
        steering       = new Steering();
        fuelTank       = new FuelTank();

        for (int i = 0; i < otherSteerings.Length; i++)
        {
            otherSteerings[i] = new OtherSteering();
        }
        carVibration        = new CarVibration();
        brakesCommon        = new Brakes();
        physicsCrashSetting = new PhysicsCrashSetting();
        ignoreHeadCollision = false;
        exhaust             = new Exhaust();
        roughness           = new Roughness();
        engineHealth        = new EngineHealth();
        fuelTankOnCrash     = 0;
        engineParticles     = new EngineParticles();
        gearboxSettings     = new GearboxSettings();
        wheels                       = new Wheel();
        body                         = new Body();
        bumper                       = new Bumper();
        windowGlass                  = new WindowGlass();
        light                        = new Light();
        licencePlate                 = new LicencePlate();
        mirror                       = new Mirror();
        wing                         = new Wing();
        door                         = new Door();
        roof                         = new Roof();
        unknown                      = new Unknown();
        engineSoundSet               = new EngineSoundSet();
        engineSound1                 = new EngineSound();
        engineSound2                 = new EngineSound();
        engineSound3                 = new EngineSound();
        engineSound4                 = new EngineSound4();
        insideSoundSet               = new InsideSoundSet();
        carSmallHitType              = new CarSmallHitType();
        carShortCrashTypeB1          = new CarShortCrashType();
        carShortCrashWithGlassTypeC1 = new CarShortCrashType();
        unknownSound1                = "";
        unknownSound2                = "";
        engineStartSound             = new EngineStartSound();
        engineSoundDriving           = new EngineSoundDriving();
        for (int i = 0; i < engineSoundOnGears.Length; i++)
        {
            engineSoundOnGears[i] = new EngineSoundOnGear();
        }
        engineSoundIdle             = new EngineSoundIdle();
        wheelSoundWhilePunctured    = new WheelSoundWhilePunctured();
        carSmallHitType1            = new CarSmallHitType();
        carLongCrashType1           = new CarLongCrashType();
        carShortCrashWithGlassType1 = new CarShortCrashType();
        doorOpenCloseSound          = new DoorOpenCloseSound();
        insideSoundSet               = new InsideSoundSet();
        carSmallHitType              = new CarSmallHitType();
        carLongCrashType2            = new CarLongCrashType();
        carShortCrashTypeB1          = new CarShortCrashType();
        carShortCrashWithGlassTypeC1 = new CarShortCrashType();
        unknownSound1               = "";
        unknownSound2               = "";
        carShortCrashTypeB2         = new CarShortCrashType();
        carShortCrashWithGlassType1 = new CarShortCrashType();
        doorOpenCloseSound          = new DoorOpenCloseSound();
    }