Inheritance: MonoBehaviour
Esempio n. 1
0
 public void Launch()
 {
     anim.SetBool("fire", true);
     animating = true;
     source.PlayOneShot(canonboom, hitVol);
     Flying clone = (Flying)Instantiate(flying, LaunchPoint.transform.position, LaunchPoint.transform.rotation);
 }
Esempio n. 2
0
        public TornadusT(double health, string status)
        {
            name  = "TornadusT";
            type1 = new Flying();

            estimatedSpeed = 309; estimatedHealth = 309; estimatedAttack = 309; estimatedDefense = 309; estimatedSpAttk = 309; estimatedSpDef = 309; move1 = new Flamethrower(); move2 = new Flamethrower(); move3 = new Flamethrower(); move4 = new Flamethrower(); Initialize(name, health, status);
        }
Esempio n. 3
0
    // Start is called before the first frame update
    void Start()
    {
        playerFlyingComponent = this.GetComponent <Flying>();
        playerFlightControls  = this.GetComponentInChildren <PlayerFlightControls>();
        altSlider.maxValue    = playerFlightControls.presetAlts[playerFlightControls.presetAlts.Length - 1];
        altSlider.minValue    = playerFlightControls.presetAlts[0];
        //altText.text = Mathf.RoundToInt(playerFlyingComponent.currentAltitude) + "m";
        sliderPresets = new Vector3[playerFlightControls.presetAlts.Length];

        // spawn the altitude labels
        for (int i = 0; i < playerFlightControls.presetAlts.Length; i++)
        {
            GameObject altitudeObject = Instantiate(altitudeTextPrefab, altSlider.transform);
            altitudeObject.GetComponent <TextMeshProUGUI>().text = ((EAlts)i).ToString();
            altitudeObject.name = ((EAlts)i).ToString() + " Altitude Text";

            float   heightPercent = playerFlightControls.presetAlts[i] / (altSlider.maxValue - altSlider.minValue);
            float   yPos          = altSlider.GetComponent <RectTransform>().rect.height *heightPercent;
            Vector3 textAlt       = new Vector3(70, yPos - 315, 0);
            altitudeObject.transform.localPosition = textAlt;

            //Debug.Log($"height%: {heightPercent}, yPos: {yPos}, altitudeObject: {altitudeObject.transform.position}");
            altitudeObject.SetActive(true);

            textAlt.x       -= 95;
            sliderPresets[i] = textAlt;
        }

        prevAltitude = playerFlightControls.currentAltSetting;
        altitudeArrow.transform.localPosition = sliderPresets[(int)playerFlightControls.currentAltSetting];
        altSlider.value = playerFlightControls.GetDynamicAlt();
    }
Esempio n. 4
0
    // Порождение монетки
    void emitCoin()
    {
        int _moneyInOneCoin = moneyInOneCoin;

        if (totalCount < _moneyInOneCoin)
        {
            _moneyInOneCoin = totalCount;
        }
        totalCount -= _moneyInOneCoin;
        //Debug.Log("coin#" + MAIN.testCountCoins + " moneyInOneCoin: "+ _moneyInOneCoin);
        if (dlFrom != null)
        {
            dlFrom.addValue(-_moneyInOneCoin);
        }
        GameObject coin = Object.Instantiate(coinPref);

        coin.GetComponent <Coin>().value = _moneyInOneCoin;
        Flying f = coin.GetComponent <Flying>();

        //Flickering fl = Flickering.set(coin, 0.03f);
        f.transform.position = new Vector2(target.position.x, target.position.y) + shiftFromPos + Utils.rand(0.03f);
        //Animation anim = coin.GetComponent<Animation>().clip();
        f.init(toTarget.position, fontainPower, new Vector2(
                   Random.Range(-fontainPower * 2.3f, fontainPower * 2.3f),
                   Random.Range(-fontainPower, fontainPower)));
        f.subscribe(onCoinArrive); // подписываемся на прибитие
        Rotating.set(coin, Random.Range(-1.0f, 1.0f));
    }
Esempio n. 5
0
File: Logo.cs Progetto: lunice/bgo
    void Start()
    {
        ///////////////////  test  //////////////////////
        //Errors.onServerError(Api.ServerErrors.E_VERSION_ERROR);
        //return;
        /////////////////////////////////////////////////
        line1 = transform.FindChild("L1").GetComponent <SpriteRenderer>();
        line2 = transform.FindChild("L2").GetComponent <SpriteRenderer>();
        morda = transform.FindChild("morda").GetComponent <SpriteRenderer>();
        var flying1 = line1.gameObject.AddComponent <Flying>();
        var flying2 = line2.gameObject.AddComponent <Flying>();

        flyingM = morda.gameObject.AddComponent <Flying>();
        flying1.init(new Vector2(0.0f, flying1.transform.position.y), 0.05f);
        flying2.init(new Vector2(0.0f, flying2.transform.position.y), 0.05f);

        flying1.destroyOnArrive = false;
        flying2.destroyOnArrive = false;
        flyingM.destroyOnArrive = false;
        label       = transform.FindChild("label").GetComponent <SpriteRenderer>();
        morda.color = new Color(1.0f, 1.0f, 1.0f, 0.0f);
        label.color = new Color(1.0f, 1.0f, 1.0f, 0.0f);
        startTime   = Time.time;
        s           = 0.5f - startFrom;
        SoundsSystem.play(Sound.S_LOGO);
    }
Esempio n. 6
0
        public Pidgeot(double health, string status)
        {
            name  = "Pidgeot";
            type1 = new Flying();
            type2 = new Normal();

            estimatedSpeed = 309; estimatedHealth = 309; estimatedAttack = 309; estimatedDefense = 309; estimatedSpAttk = 309; estimatedSpDef = 309; move1 = new Flamethrower(); move2 = new Flamethrower(); move3 = new Flamethrower(); move4 = new Flamethrower(); Initialize(name, health, status);
        }
Esempio n. 7
0
        public Gliscor(double health, string status)
        {
            name  = "Gliscor";
            type1 = new Flying();
            type2 = new Ground();

            estimatedSpeed = 309; estimatedHealth = 309; estimatedAttack = 309; estimatedDefense = 309; estimatedSpAttk = 309; estimatedSpDef = 309; move1 = new Flamethrower(); move2 = new Flamethrower(); move3 = new Flamethrower(); move4 = new Flamethrower(); Initialize(name, health, status);
        }
Esempio n. 8
0
        public Skarmory(double health, string status)
        {
            name  = "Skarmory";
            type1 = new Flying();
            type2 = new Steel();

            estimatedSpeed = 309; estimatedHealth = 309; estimatedAttack = 309; estimatedDefense = 309; estimatedSpAttk = 309; estimatedSpDef = 309; move1 = new Flamethrower(); move2 = new Flamethrower(); move3 = new Flamethrower(); move4 = new Flamethrower(); Initialize(name, health, status);
        }
Esempio n. 9
0
        public Mandibuzz(double health, string status)
        {
            name  = "Mandibuzz";
            type1 = new Dark();
            type2 = new Flying();

            estimatedSpeed = 309; estimatedHealth = 309; estimatedAttack = 309; estimatedDefense = 309; estimatedSpAttk = 309; estimatedSpDef = 309; move1 = new Flamethrower(); move2 = new Flamethrower(); move3 = new Flamethrower(); move4 = new Flamethrower(); Initialize(name, health, status);
        }
Esempio n. 10
0
        public Salamence(double health, string status)
        {
            name  = "Salamence";
            type1 = new Flying();
            type2 = new Dragon();

            estimatedSpeed = 309; estimatedHealth = 309; estimatedAttack = 309; estimatedDefense = 309; estimatedSpAttk = 309; estimatedSpDef = 309; move1 = new Flamethrower(); move2 = new Flamethrower(); move3 = new Flamethrower(); move4 = new Flamethrower(); Initialize(name, health, status);
        }
Esempio n. 11
0
    // Start is called before the first frame update
    void Awake()
    {
        da        = this.gameObject.GetComponentInParent <DynamicAltitude>();
        fly       = GameObject.FindGameObjectWithTag("PilotStation").GetComponent <Flying>();
        autoPilot = GameObject.FindObjectOfType <PlayerAutopilot>();

        audioM = GameObject.Find("AudioManager").GetComponent <AudioManager>();
    }
 protected override void Start()
 {
     base.Start();
     flying     = GetComponentInChildren <Flying>();
     flyerStats = GetComponent <FlyerStats>();
     target     = targetGiver.Player;
     StartMovement();
 }
Esempio n. 13
0
        public Zapdos(double health, string status)
        {
            name  = "Zapdos";
            type1 = new Flying();
            type2 = new Electric();

            estimatedSpeed = 309; estimatedHealth = 309; estimatedAttack = 309; estimatedDefense = 309; estimatedSpAttk = 309; estimatedSpDef = 309; move1 = new Flamethrower(); move2 = new Flamethrower(); move3 = new Flamethrower(); move4 = new Flamethrower(); Initialize(name, health, status);
        }
Esempio n. 14
0
        public Hawlucha(double health, string status)
        {
            name  = "Hawlucha";
            type1 = new Flying();
            type2 = new Fighting();

            estimatedSpeed = 309; estimatedHealth = 309; estimatedAttack = 309; estimatedDefense = 309; estimatedSpAttk = 309; estimatedSpDef = 309; move1 = new Flamethrower(); move2 = new Flamethrower(); move3 = new Flamethrower(); move4 = new Flamethrower(); Initialize(name, health, status);
        }
Esempio n. 15
0
        public Charizard(double health, string status)
        {
            name  = "Charizard";
            type1 = new Flying();
            type2 = new Fire();

            estimatedSpeed = 309; estimatedHealth = 309; estimatedAttack = 309; estimatedDefense = 309; estimatedSpAttk = 309; estimatedSpDef = 309; move1 = new Flamethrower(); move2 = new Flamethrower(); move3 = new Flamethrower(); move4 = new Flamethrower(); Initialize(name, health, status);
        }
Esempio n. 16
0
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    // Start is called before the first frame update
    void Start()
    {
        enemyFlyingComponent  = this.GetComponent <Flying>();
        playerTransform       = GameObject.FindWithTag("Player").transform;
        playerFlyingComponent = GameObject.FindWithTag("PilotStation").GetComponent <Flying>();
        currentEnemyAction    = EEnemyAction.neutralFlying;
        SetEnemysCurrentAction();
        CheckEnemysCurrentAction();
    }
Esempio n. 17
0
 public TcPrize(Flying flying)
 {
     tItem      = flying.Template;
     amount     = flying.Amount;
     isRareItem = flying.IsRareItem;
     deltaTime  = 0f;
     flickering = 0f;
     outline    = true;
 }
Esempio n. 18
0
        public override Dictionary <string, string> ReturnValue()
        {
            Dictionary <string, string> birdParameters = base.ReturnValue();

            birdParameters.Add("flying", Flying.ToString());
            birdParameters.Add("domestic", Domestic.ToString());

            return(birdParameters);
        }
Esempio n. 19
0
    void Start()
    {
        _material = GetComponent <Renderer>().material;
        Health    = MaxHealth;

        _ship = GetComponent <Flying>();

        _animator = GetComponent <Animator>();
    }
Esempio n. 20
0
    public void TweenRotation(float toRotation, float time)
    {
        Flying player = GameObject.FindWithTag("PilotStation").GetComponent <Flying>();

        changeTime = Mathf.Abs(player.currentForwardSpeed - player.desiredForwardSpeed) / player.forwardAcceleration;

        iTween.ValueTo(this.gameObject, iTween.Hash("from", prevRotation, "to", toRotation,
                                                    "time", time, "easeType", "linear",
                                                    "onupdate", "RotateZ"));
    }
        public IPacketWithSize ReadPacket(IMinecraftDataReader reader)
        {
            Flying = (Flying) reader.ReadByte();
            NoClip = (NoClip) reader.ReadByte();
            Speeding = (Speeding) reader.ReadByte();
            SpawnControl = (SpawnControl) reader.ReadByte();
            ThirdPersonView = (ThirdPersonView) reader.ReadByte();
            JumpHeight = reader.ReadShort();

            return this;
        }
Esempio n. 22
0
    // Start is called before the first frame update
    void Start()
    {
        playerFlyingComponent = this.GetComponent <Flying>();
        playerFlightControls  = this.GetComponentInChildren <PlayerFlightControls>();

        prevSpeed = playerFlightControls.currentSpeedSetting;
        SetSpeed(prevSpeed);

        speedText = this.GetComponent <HgihlightSpeed>();
        speedText.HighlightSpeed(prevSpeed);
    }
Esempio n. 23
0
        public IPacketWithSize ReadPacket(IProtocolDataReader reader)
        {
            Flying          = (Flying)reader.ReadByte();
            NoClip          = (NoClip)reader.ReadByte();
            Speeding        = (Speeding)reader.ReadByte();
            SpawnControl    = (SpawnControl)reader.ReadByte();
            ThirdPersonView = (ThirdPersonView)reader.ReadByte();
            JumpHeight      = reader.ReadShort();

            return(this);
        }
Esempio n. 24
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(gameObject);
     }
     else
     {
         _instance = this;
     }
 }
Esempio n. 25
0
    void Start()
    {
        var bc = transform.FindChild("closeBtn").GetComponent <BaseController>();

        bc.subscribeOnControllEvents(onCloseBtn);
        flyTo = transform.GetComponent <Flying>();
        flyTo.subscribe(onFlyTo);
        flyTo.destroyOnArrive = false;
        float s = HUD.isVisibleLeftRight ? 1.0f : 0.8f;

        transform.localScale = new Vector2(s, s);
    }
Esempio n. 26
0
    //=======================[hide/show system]=========================


    void initFly(Vector2 to)
    {
        Flying flying = this.gameObject.GetComponent <Flying>();

        if (flying == null)
        {
            flying = this.gameObject.AddComponent <Flying>();
            flying.subscribe(onButtonArrived);
            flying.destroyOnArrive = false;
        }
        flying.init(to, 0.03f);
    }
Esempio n. 27
0
    // Start is called before the first frame update
    void Start()
    {
        playerFlyingComponent = this.GetComponent <Flying>();
        playerFlightControls  = this.GetComponentInChildren <PlayerFlightControls>();

        speedSlider.maxValue = playerFlightControls.presetSpeeds[playerFlightControls.presetSpeeds.Length - 1];
        speedSlider.minValue = playerFlightControls.presetSpeeds[0];
        speedSlider.value    = playerFlyingComponent.currentForwardSpeed;

        speedText.text = playerFlightControls.currentSpeedSetting.ToString(); //Mathf.RoundToInt(playerFlyingComponent.currentForwardSpeed) + " mph";
        prevSpeed      = playerFlightControls.currentSpeedSetting;
    }
Esempio n. 28
0
    public void enemySpotted(Transform enemyTransform)
    {
        //Debug.Log("Spotted: " + enemyTransform.gameObject.name.ToString());

        //The values printed below should be used for drawing the radar blips
        float rotation = Flying.ConvertToPos360Dir(Vector3.SignedAngle(this.transform.forward, enemyTransform.position - this.transform.position, Vector3.up));
        float dist     = Vector3.Distance(this.transform.position, enemyTransform.position) / radius;

        //Debug.Log(this.transform.forward);
        //Debug.Log(rotation);
        //Debug.Log(dist);
        PingManager.GetComponent <PingSpawner>().SpawnPing(dist, rotation);
    }
Esempio n. 29
0
    // Калбэк приходящий непосредственно от самих шаров, при их столкновении с другими шарами, порождает звёзды, а сам шар переводит в состояние "остановлен"
    public void onNewBallStop(Ball newBall)
    {
        main.receivingTray.setBallToStopingBalls(newBall.gameObject);
        Ticket[] tickets = main.ticketHolder.getTickets();
        var      rbB     = newBall.GetComponent <Rigidbody2D>();

        for (int i = 0; (i < main.ticketHolder.transform.childCount && tickets[i] != null); i++)
        {
            TicketCell tC = tickets[i].getCellByNum(newBall.number);
            if (tC)
            {
                GameObject flyBall;
                if (flyingBallsPrefab != null && flyingBallsPrefab.GetComponent <SpriteRenderer>().sprite != null)
                {
                    flyBall = Instantiate(flyingBallsPrefab);
                }
                else
                {
                    flyBall = Instantiate(newBall.gameObject);
                }
                flyBall.transform.parent = flingBalls;
                Flying f = flyBall.AddComponent <Flying>();
                f.destroyOnArrive = false;
                f.slowdown(3.0f, 0.02f, 0.9f); // #V здесь торможение звёзд: 1 - дистанция с которой начинается торможение, 2 - до скорости, 3 - сила торможения(если 1 то нулевая сила, если 0 то мгновеная остановка, если больше одного наоборот ускорение)
                flyBall.transform.position = newBall.transform.position;
                var b = flyBall.GetComponent <Ball>();
                if (b != null)
                {
                    flyBall.name = "flingBall_" + b.number;
                    b.setOrderLayer(9);
                }
                var circleCollider = flyBall.GetComponent <CircleCollider2D>();
                if (circleCollider != null)
                {
                    circleCollider.enabled = false;
                }
                var rb = flyBall.GetComponent <Rigidbody2D>();
                if (rb != null)
                {
                    Destroy(rb);
                }
                var rotating = Rotating.set(flyBall, rbB.angularVelocity);
                rotating.slowdown(0.1f, 0.96f); // #V замедление вращение звёздочек
                f.init(tC.transform.position, 0.02f, newBall.prevVelocity[0] * 0.005f);
                f.subscribe(onBallArrive, tC.gameObject, newBall.gameObject);
                // #V эффекты на звёздочках:
                Flickering.set(flyBall, 0.15f);
                Scaling.set(flyBall, 0.5f, 0.15f);
            }
        }
    }
Esempio n. 30
0
    // Coroutine that spawns a group
    private IEnumerator SpawnGroup()
    {
        foreach (Enemy enemy in currentGroupData.enemies)
        {
            EnemyPrefabMapping prefabMapping = enemyPrefabConfig.EnemyPrefabs
                                               .Where(x => x.type == enemy.type)
                                               .FirstOrDefault();


            if (prefabMapping == null)
            {
                continue;
            }

            GameObject prefab = prefabMapping.prefab;

            GameObject obj = Instantiate(prefab);
            //flying poop code
            if (enemy.type == EnemyType.Flying)
            {
                Flying flyingObj = obj.GetComponent <Flying>();
                if (flyingObj != null)
                {
                    flyingObj.Initialize();
                    flyingObj.SetDropOffTarget(cargoTarget);
                    activeEnemies.Add(flyingObj.GetCargo().gameObject);
                }
            }

            if (enemy.spawn == SpawnPoint.Mid)
            {
                obj.transform.position = midSpawnPoint.position;
            }
            else if (enemy.spawn == SpawnPoint.High)
            {
                obj.transform.position = highSpawnPoint.position;
            }
            else
            {
                obj.transform.position = groundSpawnPoint.position;
            }
            activeEnemies.Add(obj);
            yield return(new WaitForSeconds(currentGroupData.interval));
        }

        groupOngoing = false;
        groupStarted = false;

        yield return(null);
    }
Esempio n. 31
0
    // Start is called before the first frame update
    void Awake()
    {
        //currentPosition = this.transform.position;
        //lastPosition = currentPosition;
        rigidbody = this.GetComponent <Rigidbody>();
        rigidbody.centerOfMass = Vector3.zero;

        //rigidbody.AddRelativeTorque(maxTorque, ForceMode.VelocityChange);

        startPos        = this.transform.position;
        playerTransform = GameObject.FindWithTag("Player").GetComponent <Transform>();

        missileModel = this.transform.GetChild(0).GetChild(0);

        flyingComponent = this.GetComponent <Flying>();
    }
Esempio n. 32
0
    void Start()
    {
        flyingDevice = Flying.instance;
        tailLength = firstTrailSize;
        segmentList = new LinkedList<SegmentScript>();
        trailPointList = new LinkedList<TrailPoint>();

        Vector3 newPos = transform.position;
        Quaternion newRot = transform.rotation;
        ++num;
        TrailPoint point = new TrailPoint(newPos, newRot, num, newPos.magnitude);
        point.state = SegmentState.GROUND;
        ++numOfGround;
        trailPointList.AddFirst(point);
    }
Esempio n. 33
0
 void Awake()
 {
     if (instance == null) {
         instance = this;
     }
 }
Esempio n. 34
0
 void Start()
 {
     flying = GetComponent<Flying>();
     FlapUpdate();
 }