상속: MonoBehaviour
예제 #1
0
    Command GetCommand(Action Action)
    {
        Command cmd = null;

        switch (Action)
        {
        case Action.LEFT:
            cmd = new MoveLeft(m_rebel);
            break;

        case Action.RIGHT:
            cmd = new MoveRight(m_rebel);
            break;

        case Action.JUMP:
            cmd = new Jump(m_rebel);
            break;

        case Action.DUCK:
            cmd = new Duck(m_rebel);
            break;

        case Action.COLOR:
            cmd = new ChangeColor(m_rebel);
            break;
        }

        return(cmd);
    }
예제 #2
0
    void PictureSetGenerate()
    {
        GameObject ps = Instantiate(pictureSetPrefab);

        lastGeneratedPictureSet          = ps.transform;
        lastGeneratedPictureSet.position = pictureSetInitPosition.position;

        //正解の色の決定
        DB.ColorID correctColor = ColorDecision();

        //マテリアルの作成
        Material currentMaterial = materialBuffer[currentMaterialIndex];

        MakeMaterial(currentMaterial);

        //ChangeColorの初期化
        ChangeColor changeColor = ps.GetComponent <ChangeColor>();

        changeColor.Init(currentObjectID, correctColor, currentMaterial);

        //Focusの初期化
        Focus focus = ps.GetComponent <Focus>();

        focus.Init(currentObjectID, focusFrame);

        currentObjectID++;
        currentMaterialIndex = (currentMaterialIndex + 1) % materialBufferNum;
    }
예제 #3
0
파일: HUD.cs 프로젝트: lunice/bgo
    public void playAnimNeedMore(VisualValuesType typeT)
    {
        PushDownButton target  = null;
        DigitsLabel    targetD = null;
        MAIN           main    = MAIN.getMain;

        switch (typeT)
        {
        case VisualValuesType.VVT_MONEY: { target = moneyBtn; targetD = main.money; } break;

        case VisualValuesType.VVT_RUBINS: { target = rubinsBtn; targetD = main.rubins; } break;

        case VisualValuesType.VVT_XP: { target = expBtn; /* EXP! */ } break;

        default: { if (MAIN.IS_TEST)
                   {
                       Errors.show("Неизвестный тип отображаемых значений HUD-a:" + typeT);
                   }
        } return;
        }
        SoundsSystem.play(Sound.S_NEED_MORE_FUNDS);
        if (target.GetComponent <Scaling>() != null)
        {
            return;
        }
        Utils.increaseOrder(target.transform, changeOrderValueForNeedMoreButton);
        var scalingAnim = Scaling.set(target.gameObject, 1.3f, 1.5f, 1);

        scalingAnim.subscribeOnScalingFinish(onNeedMoreScalingAnim);
        ChangeColor.set(targetD.transform, new Color(1.0f, 0.0f, 0.0f, 1.0f), 0.25f, true, 6);
        _isPlaingAnim = true;
    }
예제 #4
0
    // 设置名称
    public void createSphere(float N)
    {
        float inc = Mathf.PI * (3 - Mathf.Sqrt(5));
        float off = 2 / N;

        for (int k = 0; k < (N); k++)
        {
            float   y   = k * off - 1 + (off / 2);
            float   r   = Mathf.Sqrt(1 - y * y);
            float   phi = k * inc;
            Vector3 pos = new Vector3((Mathf.Cos(phi) * r * size), y * size, Mathf.Sin(phi) * r * size);

            GameObject  text        = (GameObject)Instantiate(textObject, pos, Quaternion.identity);
            ChangeColor changeColor = text.GetComponent <ChangeColor> ();
            text.transform.parent = gameObject.transform;

            City     city = citys [k] as City;
            TextMesh tm   = (TextMesh)text.GetComponent <TextMesh> ();

            tm.text = city.getName();


            tm.color = city.getWeatherColor();
            text.transform.localScale = city.getSize();
            text.GetComponent <ChangeColor> ().oldScale = text.transform.localScale;

            foreach (Transform child in text.transform)
            {
                TextMesh tm2 = (TextMesh)child.GetComponent <TextMesh> ();
                tm2.text  = city.getTempture();
                tm2.color = city.getWeatherColor();
            }
        }
    }
예제 #5
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
        }
                #if UNITY_IOS
        System.Environment.SetEnvironmentVariable("MONO_REFLECTION_SERIALIZER", "yes");
                #endif
        TotalData.LoadTotalFromFile();
        if (TotalData.total.firstGame)
        {
            transform.GetComponent <SpriteRenderer> ().color = newColorRange [0];
            transform.GetChild(1).GetComponent <TrailRenderer> ().enabled = true;
            enabledTrail = 1;
        }
        else
        {
            randomColor = Random.Range(0, newColorRange.Length);
            transform.GetComponent <SpriteRenderer> ().color = newColorRange [randomColor];
        }

        if (randomColor == newColorRange.Length - 1)
        {
            line.transform.GetChild(0).GetComponent <SpriteRenderer> ().color = newColorRange [0];
        }
        else
        {
            line.transform.GetChild(0).GetComponent <SpriteRenderer> ().color = newColorRange [randomColor + 1];
        }
    }
예제 #6
0
    // Use this for initialization
    void Start()
    {
        changecolor = character.GetComponent <ChangeColor>();
        LoadFile("C:/Users/mar39lw/Documents/Projects/2017_Genf/ECG data/ecg9.csv");

        ecg_diff_firstseconds = new float[300]; // 5 seconds
    }
예제 #7
0
    //private float getMouse1DownTime = 0f;
    ////计数器
    //private int getDownCount = 0;
    //// Use this for initialization
    void Start()
    {
        //    Time.timeScale = 0;
        changecolor = GameObject.Find("points").GetComponent <ChangeColor>();
        LoadPaota();
        for (int i = 0; i < 5; i++)
        {
            paota[i]       = (Button)GameTools.FindGameObjectByParent("GameUI/paotaUI/paota" + (i + 1) + "/Button/").GetComponent <Button>();
            paota_image[i] = (GameObject)GameTools.FindGameObjectByParent("GameUI/paotaUI/paota" + (i + 1) + "/Image/");
            paota_image[i].SetActive(false);
        }
        for (int i = 0; i < 5; i++)
        {
            int temp = i;
            //   Debug.Log(i);
            paota[i].onClick.AddListener(() => {
                //   Debug.Log("添加炮塔Button点击事件");
                showPaotaData(temp);
            });
        }

        introduction     = (Text)GameTools.FindGameObjectByParent("GameUI/paotaUI/introduction/").GetComponent <Text>();
        attack           = (Text)GameTools.FindGameObjectByParent("GameUI/paotaUI/attack/").GetComponent <Text>();
        attdistance      = (Text)GameTools.FindGameObjectByParent("GameUI/paotaUI/attdistance/").GetComponent <Text>();
        attackinterval   = (Text)GameTools.FindGameObjectByParent("GameUI/paotaUI/attackinterval/").GetComponent <Text>();
        cost             = (Text)GameTools.FindGameObjectByParent("GameUI/paotaUI/cost/").GetComponent <Text>();
        jineng_manager   = GameTools.FindGameObjectByParent("jinengManager/").GetComponent <jinengManager>();
        tip              = (Text)GameTools.FindGameObjectByParent("GameUI/tip/").GetComponent <Text>();
        remain_paota_num = (Text)GameTools.FindGameObjectByParent("GameUI/remain_paota_num/").GetComponent <Text>();
        tip.text         = "";
    }
예제 #8
0
    // Start is called before the first frame update
    void Start()
    {
        onChangeColor = UpdateColor;//Setting the delagate to method, the method you set to delagate needs
        //to have exact same type and input sa delagate it self
        //for example we can not do
        //onChangeColor = Task2;//this will throw an error the type is the same both are void but
        //task2 does not have any input but onChangeColor Delagate needs method that is void and take color as input
        onChangeColor(Color.green);//inovking the delagate

        //onComplete = Task;
        //Statcking methods on onComplete delegate
        //you use += sign when you have multiple method
        onComplete += Task;
        onComplete += Task1;
        onComplete += Task2;
        //you can also remove task from delegate
        onComplete -= Task1;
        //Best practice is before invoking delegate
        //check if it's not null
        if (onComplete != null)
        {
            //Invoking method
            onComplete();
        }
    }
예제 #9
0
        public MainPage()
        {
            this.InitializeComponent();
            f = this.RequestedTheme;

            //Разрешить использовать собственный заголовок (как следствие убрать стандартный)
            CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;



            //CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;

            ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;

            titleBar.ButtonBackgroundColor         = Colors.Transparent;
            titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;

            // Инициализация начальными значениями контролов.
            userColor = new ChangeColor(Color.FromArgb(255, 255, 70, 0));

            // Текущая схема
            vmHarmony = new Harmony(userColor, frame, 0);


            managerTheme = new Theme();
        }
예제 #10
0
        // Start is called before the first frame update
        void Start()
        {
            //The signature of the delegate must match the method being assigned to it
            //So, this line will not work:
            //onColorChange = Task;

            //Assigning methods to delegates
            onColorChange = UpdateColor;
            onComplete    = Task1;

            onColorChange(Color.green);
            onComplete();

            onComplete += Task2;
            onComplete += Task3;

            onComplete -= Task2;

            /*Since we are adding and removing objects,
             * it is a good idea to make sure onComplete is not null
             * before we call the method the delegate is holding.
             */
            if (onComplete != null)
            {
                onComplete();
            }
        }
예제 #11
0
        public bool IsCheck()                            // проверка на шах
        {
            Board after = new Board(fenchess);           // создаём доску

            after.ChangeColor = ChangeColor.FlipColor(); // меняем цвет после хода
            return(after.KingEatPos());
        }
예제 #12
0
    // Use this for initialization
    void Start()
    {
        otherScript = CubeObject.GetComponent <ChangeColor>();
        newMatTwo   = otherScript.newMat;

        Debug.Log(newMatTwo[1, 1]);
    }
예제 #13
0
 // Use this for initialization
 void Start()
 {
     for (int i = 0; i < 5; i++)
     {
         jienng[i]     = (Button)GameTools.FindGameObjectByParent("GameUI/jinengUI/jineng" + (i + 1) + "/").GetComponent <Button>();
         iamge_time[i] = (Image)GameTools.FindGameObjectByParent("GameUI/jinengUI/jineng" + (i + 1) + "/").GetComponent <Image>();
         int temp = i;
         //   Debug.Log("添加响应事件" + temp);
         jienng[i].onClick.AddListener(() =>
         {
             //    Debug.Log("添加技能点击响应事件" + temp);
             onclickJineng(temp);
         });
         lenque_time[i]       = 20;
         total_lenque_time[i] = 20;
         jinengCom[i]         = (base_jineng)GameTools.FindGameObjectByParent("jinengManager/jineng" + (i + 1) + "/").GetComponent <base_jineng>();
     }
     changecolor = GameObject.Find("points").GetComponent <ChangeColor>();
     circle      = (GameObject)GameTools.FindGameObjectByParent("jinengManager/circle/");
     circle.GetComponent <TrollDrawLine>().setRadius(10);
     circle.SetActive(false);
     wujiaoxing = (GameObject)GameTools.FindGameObjectByParent("jinengManager/wujiaoxing/");
     wujiaoxing.GetComponent <wujiaoxing>().setRadius(10);
     wujiaoxing.SetActive(false);
     tips   = (GameObject)GameTools.FindGameObjectByParent("GameUI/jineng_tips/");
     putCom = GameTools.FindGameObjectByParent("GameManager/").GetComponent <put_paota>();
     tips.SetActive(false);
 }
예제 #14
0
    public static ChangeColor set(Transform target, Color onColor, float period, bool smoothness = true, int countCycles = -1)
    {
        ChangeColor cce = new ChangeColor(target, onColor, period, smoothness, countCycles);
        var         e   = Effects.getEffects(target.gameObject);

        e.addNewEffect(cce);
        return(cce);
    }
예제 #15
0
    protected virtual void Awake()
    {
        _renderer = GetComponent <SpriteRenderer>();
        _change   = GetComponent <ChangeColor>();

        _currentLives  = _maxLives;
        _currentHealth = _maxHealth;
    }
예제 #16
0
    public static void ChangeColor(GameObject go, Collision co, Material target, float time = 1)
    {
        ChangeColor cc = go.AddComponent <ChangeColor>();

        cc.contact = co.contacts[0].point;
        cc.target  = target;
        cc.time    = time;
    }
예제 #17
0
 // Use this for initialization
 void Start()
 {
     painter    = GetComponent <ChangeColor>();
     melody     = GetComponent <AudioSource>();
     scoreBoard = GetComponent <Scores>();
     Pause();
     SetColors();
 }
예제 #18
0
    // The event listener. Emits a change color message when the dropdown changes.
    public void ShouldChangeColor(int index)
    {
        // Get the color represented by the dropdown.
        Color color = ChangeColor.colorForIndex(index);

        // Emit a new message with the given color.
        new ShouldChange(color).emitSelf();
    }
예제 #19
0
 private void Awake()
 {
     m_rendere = GetComponent <MeshRenderer>();
     if (m_child == this)
     {
         m_child = null;
     }
 }
예제 #20
0
 public void Start()
 {
     ChangeColor = FlagProp.ToMVVMReactiveCommand();
     ChangeColor.Subscribe(_ => Color.Value = Random.ColorHSV());
     Text.Value = DateTime.Now.ToShortTimeString();
     CoExecute.Execute(ChangeRoutine);
     CoExecute.Execute(UnityUpdate);
 }
예제 #21
0
 void SetScripts()
 {
     searchPlatform   = gameObjectSelected.GetComponent <SearchPlatform>();
     platformRotation = gameObjectSelected.GetComponent <PlatformRotation>();
     movePlatform     = gameObjectSelected.GetComponent <MovePlatform>();
     changeColor      = gameObjectSelected.GetComponent <ChangeColor>();
     movePlatform.SetLastPosition(gameObjectSelected.transform.position);
     movePlatform.SetCamera(gameplayCamera);
 }
예제 #22
0
    void ApplySkin(int model, int skin)
    {
        GameObject mod = gameObject.transform.GetChild(5).GetChild(model).gameObject;

        mod.SetActive(true);
        ChangeColor col = mod.GetComponentInChildren(typeof(ChangeColor)) as ChangeColor;

        col.x = skin;
    }
 internal ObjectAttachmentBlockBase(BinaryReader binaryReader)
 {
     this.type           = binaryReader.ReadTagReference();
     this.marker         = binaryReader.ReadStringID();
     this.changeColor    = (ChangeColor)binaryReader.ReadInt16();
     this.invalidName_   = binaryReader.ReadBytes(2);
     this.primaryScale   = binaryReader.ReadStringID();
     this.secondaryScale = binaryReader.ReadStringID();
 }
예제 #24
0
    void Start()
    {
        playerColor = GameObject.Find("Player").gameObject.GetComponent <ChangeColor>();

        render = gameObject.GetComponent <LineRenderer>();

        render.startColor = playerColor.render.material.color;
        render.endColor   = playerColor.render.material.color;
    }
예제 #25
0
    private void Start()
    {
        data         = GetComponent <PlayerMovement>().GetData();
        colorChanger = GetComponentInChildren <ChangeColor>();

        currentHealth = data.maxHealth;

        defaultSize = healthBar.sizeDelta;
    }
예제 #26
0
        public BasePropertyChanger GetPropertyChanger()
        {
            ChangeColor result      = new ChangeColor();
            HueSatLight hueSatLight = GetHsl();
            float       multiplier  = trkMultiplier.Value / 10.0f;

            result.SetValue(hueSatLight.AsHtml, multiplier);
            return(result);
        }
예제 #27
0
    // Start is called before the first frame update
    private void Awake()
    {
        UIAPI       = GetComponent <UI_API>();
        changeColor = GetComponent <ChangeColor>();
        golemScript = GetComponent <GollemScript>();

        PowerUpCount = 0;
        PlayerScore  = 0;
    }
예제 #28
0
 private void Start()
 {
     SetRotateValue();
     changeColor     = GetComponentInChildren <ChangeColor>();
     areaChilders[0] = transform.GetChild(0).gameObject.transform.GetChild(0).GetComponent <AreaChilder>();
     areaChilders[1] = transform.GetChild(0).gameObject.transform.GetChild(1).GetComponent <AreaChilder>();
     obj             = GameObject.Find("SuitsukiObj").GetComponent <PointerSuitsuki>();
     effect          = Resources.Load("TurnBoardEffect") as GameObject;
     //rpc = GameObject.Find("RotatePointController").GetComponent<RotatePointController>();
 }
예제 #29
0
 public void ShouldChangeColor1000Times()
 {
     for (int i = 0; i < 1000; ++i)
     {
         // Get the color represented by the dropdown.
         Color color = ChangeColor.colorForIndex(Random.Range(0, 3));
         // Emit a new message with the given color.
         new ShouldChange(color).emitSelf();
     }
 }
예제 #30
0
    private void Start()
    {
        audioSource  = GetComponentInParent <AudioSource>();
        animator     = GetComponent <Animator>();
        movement     = GetComponentInParent <PlayerMovement>();
        colorChanger = gun.GetComponent <ChangeColor>();

        data = movement.GetData();

        mainCameraTransform = Camera.main.transform;
    }
        public MainWindow()
        {
            InitializeComponent();
            def = Green.Fill;

            changeLight = new ChangeLight();

            RY = new ChangeRedYellow(this, changeLight);
            YG = new ChangeYellowGreen(this, changeLight);
            GY = new ChangeGreenYellow(this, changeLight);
            YR = new ChangeYellowRed(this, changeLight);

            myDelegate = new ChangeColor(ChangeColorMethod);
        }
        public MainWindow()
        {
            InitializeComponent();
            def = Green.Fill;

            RY = new ChangeRedYellow(this);
            YG = new ChangeYellowGreen(this);
            GY = new ChangeGreenYellow(this);
            YR = new ChangeYellowRed(this);

            myDelegateYellow = new ChangeColor(ChangeToYellowMethod);
            myDelegateRed = new ChangeColor(ChangeToRedMethod);
            myDelegateGreen = new ChangeColor(ChangeToGreenMethod);
            //Control f = this;
        }