Ejemplo n.º 1
0
 void Awake()
 {
     icon			=	transform.GetChild(0).GetComponent<IconManager>();
     icon.No			=	PlayerNum;
     image			=	GetComponent<Image>();
     trans			=	image.rectTransform;
     controlFlg		=	false;
 }
Ejemplo n.º 2
0
 public static void SetIcon(this GameObject gObj, IconManager.Icon icon)
 {
     if (icon == IconManager.Icon.None)
     {
         IconManager.RemoveIcon(gObj);
     }
     else
     {
         IconManager.SetIcon(gObj, icon);
     }
 }
Ejemplo n.º 3
0
        public static bool Render(string input, ref bool dialogOpened)
        {
            if (string.IsNullOrEmpty(OutputName))
            {
                OutputName = input;
            }

            bool hasInput = false;

            if (ImGui.BeginCombo("Selected", OutputName))
            {
                popupOpened = true;

                byte[] data = Encoding.UTF8.GetBytes(OutputName);
                if (ImGui.InputText("Name", data, 200))
                {
                    OutputName = Encoding.UTF8.GetString(data);
                    hasInput   = true;
                }
                foreach (var model in GLFrameworkEngine.DataCache.ModelCache.Values)
                {
                    if (model is BfresRender)
                    {
                        var bfres = model as BfresRender;
                        foreach (var tex in bfres.Textures.Values)
                        {
                            bool isSelected = OutputName == tex.Name;

                            IconManager.LoadTexture(tex.Name, tex);
                            ImGui.SameLine();

                            if (ImGui.Selectable(tex.Name, isSelected))
                            {
                                OutputName = tex.Name;
                                hasInput   = true;
                            }

                            if (isSelected)
                            {
                                ImGui.SetItemDefaultFocus();
                            }
                        }
                    }
                }
                ImGui.EndCombo();
            }
            else if (popupOpened)
            {
                dialogOpened = false;
                popupOpened  = false;
            }
            return(hasInput);
        }
Ejemplo n.º 4
0
    //TODO add a list of sprites for use as a different kind of icons, for example attack, dash, dodge ... etc option icons

    // Use this for initialization
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }
        DontDestroyOnLoad(gameObject);
    }
Ejemplo n.º 5
0
    public override void UpdateValues()
    {
        maxWorkers.text    = Controller.instance.currentEttWorkers + "";
        maxManagers.text   = Controller.instance.currentEttManagers + "";
        raiseWorkers.text  = Mathf.Pow(Controller.instance.baseCostEttWorkers, (float)Controller.instance.currentEttWorkers) + "";
        raiseManagers.text = Mathf.Pow(Controller.instance.baseCostEttManagers, (float)Controller.instance.currentEttManagers) + "";

        while (firstWorkerRow.childCount > 0)
        {
            Destroy(firstWorkerRow.GetChild(0).gameObject);
        }
        while (secondWorkerRow.childCount > 0)
        {
            Destroy(secondWorkerRow.GetChild(0).gameObject);
        }

        int i;

        for (i = 0; i < 5 && i < Controller.instance.ettWorkers.Length; ++i)
        {
            IconWorker icon = Instantiate(iconWorkerPrefab, firstWorkerRow).GetComponent <IconWorker> ();
            icon.i               = i;
            icon.worker          = Controller.instance.ettWorkers[i];
            icon.name.text       = icon.worker.name;
            icon.laziness.text   = icon.worker.laziness.ToString("0.00");
            icon.efficiency.text = icon.worker.efficiency.ToString("0.00");
            icon.bought          = Controller.instance.ettWorkersBought [i];
            icon.panel           = this;
        }
        for ( ; i < Controller.instance.ettWorkers.Length; ++i)
        {
            IconWorker icon = Instantiate(iconWorkerPrefab, secondWorkerRow).GetComponent <IconWorker> ();
            icon.i               = i;
            icon.worker          = Controller.instance.ettWorkers[i];
            icon.name.text       = icon.worker.name;
            icon.laziness.text   = icon.worker.laziness.ToString("0.00");
            icon.efficiency.text = icon.worker.efficiency.ToString("0.00");
            icon.bought          = Controller.instance.ettWorkersBought [i];
            icon.panel           = this;
        }

        for (i = 0; i < 5 && i < Controller.instance.ettManagers.Length; ++i)
        {
            IconManager icon = Instantiate(iconManagerPrefab, managerRow).GetComponent <IconManager> ();
            icon.i               = i;
            icon.manager         = Controller.instance.ettManagers[i];
            icon.name.text       = icon.manager.name;
            icon.laziness.text   = icon.manager.proficiency.ToString("0.00");
            icon.efficiency.text = icon.manager.efficiency.ToString("0.00");
            icon.bought          = Controller.instance.ettManagersBought [i];
            icon.panel           = this;
        }
    }
Ejemplo n.º 6
0
        /// <summary>
        /// Return the icon associated with the current extension
        /// </summary>
        /// <param name="width">Size of the icon</param>
        /// <returns>The extension icon, as Bitmap</returns>
        private Bitmap ExtensionSystemIcon(uint width)
        {
            IconManager.IImageListSize size =
                width <= 16 ? IconManager.IImageListSize.SHIL_SMALL :
                width <= 32 ? IconManager.IImageListSize.SHIL_LARGE :
                width <= 48 ? IconManager.IImageListSize.SHIL_EXTRALARGE :
                IconManager.IImageListSize.SHIL_JUMBO;

            BitmapSource icon = IconManager.GetFileIcon(extension, size, false);

            return(IconManager.BitmapSourceToBitmap(icon));
        }
Ejemplo n.º 7
0
	// BIG TODO: change the hierarchy to a messaging system
	void Start() {
		// TODO: make this read from a file instead of hardcoded ofc lol
		foodWeb = new RungeEcosystem();
		foodWeb.AddSpecies("grass",       -0.03f,  1.0f,  0f);
		foodWeb.AddSpecies("oak tree",    -0.03f,  0.8f, 10f);
		foodWeb.AddSpecies("berries",     -0.03f,  0.6f, 10f);
		foodWeb.AddSpecies("rabbit",      -0.01f, -0.1f,  0f);
		foodWeb.AddSpecies("caterpillar", -0.01f, -0.2f, 10f);
		foodWeb.AddSpecies("squirrel",    -0.01f, -0.2f, 10f);
		foodWeb.AddSpecies("fox",         -0.01f, -0.2f,  0f);
		
		foodWeb.AddInteraction("rabbit",      "grass",       0.05f, 0.8f);
		foodWeb.AddInteraction("rabbit",      "berries",     0.02f, 0.8f);
		foodWeb.AddInteraction("squirrel",    "berries",     0.02f, 0.8f);
		foodWeb.AddInteraction("squirrel",    "oak tree",    0.04f, 0.8f);
		foodWeb.AddInteraction("caterpillar", "oak tree",    0.04f, 0.8f);
		foodWeb.AddInteraction("fox",         "berries",     0.02f, 0.5f);
		foodWeb.AddInteraction("fox",         "squirrel",    0.02f, 0.6f);
		foodWeb.AddInteraction("fox",         "rabbit",      0.05f, 0.6f);
		foodWeb.AddInteraction("fox",         "caterpillar", 0.01f, 0.5f);
		// TODO: add humans hunting as the interesting bit of this ecosystem

		Transform iconTransform = new GameObject("Icon Manager").transform; // for organisation
		iconTransform.SetParent(transform);
		iconWeb = new IconManager(iconTransform, transferPrefab, interactionPrefab);
		iconWeb.AddSpecies("grass",       'p',    0f,  0f,  100f, 1f, iconPrefab, pictures[0], Color.green);
		iconWeb.AddSpecies("oak tree",    'p',    0f, 10f,  100f, 1f, iconPrefab, pictures[1], Color.black);
		iconWeb.AddSpecies("berries",     'p',    0f, 10f,  100f, 1f, iconPrefab, pictures[2], Color.magenta);
		iconWeb.AddSpecies("rabbit",      'h',    1f,  0f,  100f, 1f, iconPrefab, pictures[3], Color.grey);
		iconWeb.AddSpecies("caterpillar", 'h', 0.03f, 10f,  100f, 1f, iconPrefab, pictures[4], Color.yellow);
		iconWeb.AddSpecies("squirrel",    'h',  0.5f, 10f,  100f, 1f, iconPrefab, pictures[5], Color.white);
		iconWeb.AddSpecies("fox",         'o',    5f,  0f,  100f, 1f, iconPrefab, pictures[6], Color.red);

		speciesNames = new List<string>();
		speciesNames.Add("grass");
		speciesNames.Add("oak tree");
		speciesNames.Add("berries");
		speciesNames.Add("rabbit");
		speciesNames.Add("caterpillar");
		speciesNames.Add("squirrel");
		speciesNames.Add("fox");
		foreach (string species in speciesNames) SetIconInteractionSprings(species);
		
		CreateGraph();
		InvokeRepeating("UpdateIconPopulations", 0.7f, 2f);

		screenWidth = 2f * Camera.main.orthographicSize * Screen.width / Screen.height;
		screenHeight = screenWidth / Screen.width * Screen.height;

		gui = transform.Find("GUI").GetComponent<GUI>();
		gui.Init(screenWidth, screenHeight);
	}
Ejemplo n.º 8
0
        public void InitializeContext()
        {
            int port = Settings.Default.ListenPort;
            List <IPEndPoint> endpoints = new List <IPEndPoint>();

            switch (Settings.Default.ListenAddressesMode)
            {
            case ListenAddressMode.LOCAL_ONLY:
                endpoints.Add(new IPEndPoint(IPAddress.Loopback, port));
                endpoints.Add(new IPEndPoint(IPAddress.IPv6Loopback, port));
                break;

            case ListenAddressMode.CUSTOM:
                if (Settings.Default.ListenAddressesCustom != null && Settings.Default.ListenAddressesCustom.Count > 0)
                {
                    for (int i = Settings.Default.ListenAddressesCustom.Count - 1; i >= 0; i--)
                    {
                        var       addrStr = Settings.Default.ListenAddressesCustom[i];
                        IPAddress addr;
                        if (IPAddress.TryParse(addrStr, out addr))
                        {
                            endpoints.Add(new IPEndPoint(addr, port));
                        }
                        else
                        {
                            Settings.Default.ListenAddressesCustom.RemoveAt(i);
                        }
                    }
                }
                else
                {
                    Logger.Warn("Custom listen addresses was empty, falling back to localhost only...");
                    endpoints.Add(new IPEndPoint(IPAddress.Loopback, port));
                    endpoints.Add(new IPEndPoint(IPAddress.IPv6Loopback, port));
                }
                break;

            case ListenAddressMode.ANY:
                foreach (NetworkInterface iface in NetworkInterface.GetAllNetworkInterfaces())
                {
                    foreach (var ifaceAddr in iface.GetIPProperties().UnicastAddresses)
                    {
                        endpoints.Add(new IPEndPoint(ifaceAddr.Address, port));
                    }
                }
                break;
            }
            _PluginManager  = new PluginManager(Path.Combine(Assembly.GetEntryAssembly().GetAssemblyDir(), "plugins"));
            _ControlService = new RemoteControlService(_AppDataPath, _PluginManager);
            _WebServer      = new WebServer(_ControlService, endpoints.ToArray());
            _IconManager    = new IconManager(Path.Combine(_AppDataPath, "icons"));
        }
Ejemplo n.º 9
0
    public void rebirthbtnClick()
    {
        EmploymentManager employ    = GameObject.Find("EmployManager").GetComponent <EmploymentManager> ();
        IconManager       potioncnt = GameObject.Find("IconManager").GetComponent <IconManager>();

        RebirthCount++;
        if (potioncnt.rebirthpotion != 0)
        {
            totalrandum = Random.Range(0, 10000);
            if (totalrandum <= 5000)
            {
                gmfrrebirth();
                Alramspoon[0].active = true;
            }
            else if (totalrandum <= 8000 && totalrandum > 5000)
            {
                plasticrebirth();
                Alramspoon[1].active = true;
            }
            else if (totalrandum <= 9500 && totalrandum > 8000)
            {
                nokrebirth();
                Alramspoon[2].active = true;
            }
            else if (totalrandum <= 9800 && totalrandum > 9500)
            {
                dongrebirth();
                Alramspoon[3].active = true;
            }
            else if (totalrandum <= 9900 && totalrandum > 9800)
            {
                silverrebirth();
                Alramspoon[4].active = true;
            }
            else if (totalrandum <= 9980 && totalrandum > 9900)
            {
                goldrebirth();
                Alramspoon[5].active = true;
            }
            else if (totalrandum <= 10000 && totalrandum > 9980)
            {
                diarebirth();

                Alramspoon[6].active = true;
            }
            popup.active             = false;
            potioncnt.rebirthpotion -= 1;
            AlramPopup.active        = true;

            employ.chunsooruExist = false;
        }
    }
Ejemplo n.º 10
0
    private void InitItemsThings(int count)
    {
        listItemThings = new List <ItemThings>();

        for (int i = 0; i < count; i++)
        {
            ItemThings itemThings = Instantiate(prefabItem, transform);
            itemThings.SetImage(IconManager.GetRandomSprite1x1());
            listItemThings.Add(itemThings);
        }

        listPool = new List <ItemThings>(listItemThings);
    }
Ejemplo n.º 11
0
        public SourceNode(Snapin snapin, Source source)
            :       base(snapin, typeof(EventStatusEditor).GUID)
        {
            // Properties

            DisplayName = source.RelativeQualifiedReference;
            m_source    = source;

            // Images.

            AddImage(IconManager.GetResourceName(Icons.Source));
            AddImage(IconManager.GetResourceName(Icons.Source, IconMask.ReadOnly));
        }
Ejemplo n.º 12
0
 /// <summary>
 /// This function is called when the object becomes enabled and active.
 /// </summary>
 void OnEnable()
 {
     if (this.lookAtPoint == null)
     {
         this.lookAtPoint           = new GameObject("look at point");
         this.lookAtPoint.hideFlags = HideFlags.HideInInspector | HideFlags.DontSave;
         if (this.target != null)
         {
             this.lookAtPoint.transform.position = this.target.transform.position;
         }
         IconManager.SetIcon(this.lookAtPoint, IconManager.LabelIcon.Red);
     }
 }
Ejemplo n.º 13
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var fileName = value as string;

            var icon = IconManager.FindIconForFilename(fileName, true);

            if (icon == null)
            {
                // TODO: get default icon if no icon found for file type
            }

            return(icon);
        }
Ejemplo n.º 14
0
 static int set_mInst(IntPtr L)
 {
     try
     {
         IconManager arg0 = (IconManager)ToLua.CheckObject <IconManager>(L, 2);
         IconManager.mInst = arg0;
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 15
0
 void Awake()
 {
     #region singleton
     if (instance != null)
     {
         DestroyImmediate(this);
     }
     else
     {
         instance = this;
     }
     #endregion
 }
Ejemplo n.º 16
0
        //  private SerializedProperty eventTrigger;
        //private SerializedProperty moveNextTrigger;
        //private SerializedObject myNodeData;

        /// the matching selectedNodeDatas matching reflected data
        // private SerializedObject matchingNodeDataSerializedObject;
        /// <summary>
        /// the matching selectedNodeDatas matching reflected datas condition
        /// </summary>


        #endregion

        public void OnEnable()
        {
            #region set the icon
            if (!iconSet)
            {
                var selectedDialoguer = (Dialoguer)target;
                IconManager.SetIcon(selectedDialoguer, IconManager.DaiMangouIcons.ChatIcon);
                iconSet = true;
            }
            #endregion

            ScreenRect.size = new Vector2(Screen.width, Screen.height);
        }
Ejemplo n.º 17
0
    private void AddDumpNode(string dumpName, Transform parent, bool isAddedToReference = false, VehicleComponentsReferenceManager referenceManager = null)
    {
        GameObject DumpNode = new GameObject(dumpName);

        DumpNode.transform.SetParent(parent);
        DumpNode.transform.localPosition    = ((VehicleObjectTransformData)vehicleData.cacheData.GetType().GetField(dumpName).GetValue(vehicleData.cacheData)).localPosition;
        DumpNode.transform.localEulerAngles = ((VehicleObjectTransformData)vehicleData.cacheData.GetType().GetField(dumpName).GetValue(vehicleData.cacheData)).localEulerAngle;
        IconManager.SetIcon(DumpNode, IconManager.LabelIcon.Orange);
        if (isAddedToReference)
        {
            referenceManager.GetType().GetField(dumpName).SetValue(referenceManager, DumpNode);
        }
    }
Ejemplo n.º 18
0
 private void OnDrawGizmos()
 {
     _bones = GetComponentsInChildren <Transform>(true);
     foreach (Transform bone in _bones)
     {
         if (ShowGizmos && !bone.name.Contains("Weapon"))
         {
             if (bone.name.Contains("Tip") || bone.name.Contains("Nub"))
             {
                 Gizmos.color = Color.yellow;
                 Gizmos.DrawWireSphere(bone.position, radius * 0.6f);
                 bone.gameObject.SetActive(false);
             }
             else if (bone.name.Contains("Footsteps"))
             {
                 Vector3 offset = new Vector3(0, 0, footsteparea.z);
                 Gizmos.color = Color.blue;
                 Gizmos.DrawCube(bone.position - offset / 2f, footsteparea);
                 Gizmos.color = Color.green;
                 Gizmos.DrawCube(bone.position + offset / 2f, footsteparea);
             }
             else
             {
                 Gizmos.color = Color.red;
                 Gizmos.DrawWireSphere(bone.position, radius);
                 if (bone.parent)
                 {
                     Gizmos.color = Color.cyan;
                     Gizmos.DrawLine(bone.position, bone.parent.position);
                 }
                 if (bone.name.Contains("L"))
                 {
                     IconManager.SetIcon(bone.gameObject, IconManager.Icon.DiamondGreen);
                 }
                 else if (bone.name.Contains("R"))
                 {
                     IconManager.SetIcon(bone.gameObject, IconManager.Icon.DiamondBlue);
                 }
                 else
                 {
                     IconManager.SetIcon(bone.gameObject, IconManager.Icon.DiamondRed);
                 }
                 continue;
             }
         }
         else
         {
             IconManager.RemoveIcon(bone.gameObject);
         }
     }
 }
Ejemplo n.º 19
0
        /// <summary>
        /// The entry point.
        /// </summary>
        public static void Main()
        {
            // Bind any unhandled exceptions in the main thread so that they are logged.
            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            // Set correct working directory for compatibility with double-clicking
            Directory.SetCurrentDirectory(DirectoryHelpers.GetLocalDir());

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                Environment.SetEnvironmentVariable("GSETTINGS_SCHEMA_DIR", "share\\glib-2.0\\schemas\\");
            }

            log4net.Config.XmlConfigurator.Configure();

            Log.Info("----------------");
            Log.Info("Initializing Everlook...");

            Log.Info("Initializing OpenTK...");

            // OpenGL
            var toolkitOptions = new ToolkitOptions
            {
                Backend = PlatformBackend.PreferNative,
                EnableHighResolution = true
            };

            using (Toolkit.Init(toolkitOptions))
            {
                Log.Info($"OpenTK initialized using the {GetOpenTKBackend()} backend.");

                Log.Info("Initializing GTK...");

                // Bind any unhandled exceptions in the GTK UI so that they are logged.
                ExceptionManager.UnhandledException += OnGLibUnhandledException;

                Log.Info("Registering treeview types with the native backend...");
                GType nodeType = (GType)typeof(SerializedNode);
                GType.Register(nodeType, typeof(SerializedNode));

                GType referenceType = (GType)typeof(FileReference);
                GType.Register(referenceType, typeof(FileReference));

                // GTK
                IconManager.LoadEmbeddedIcons();
                Application.Init();
                MainWindow win = MainWindow.Create();
                win.Show();
                Application.Run();
            }
        }
Ejemplo n.º 20
0
    // Update is called once per frame
    void Update()
    {
        IconManager potioncnt = GameObject.Find("IconManager").GetComponent <IconManager>();

        potcnt_text.text = "환생물약:" + potioncnt.rebirthpotion + "개";
        if (potioncnt.rebirthpotion == 0)
        {
            rebirthbtn.interactable = false;
        }
        if (potioncnt.rebirthpotion != 0)
        {
            rebirthbtn.interactable = true;
        }
    }
Ejemplo n.º 21
0
    void Awake()
    {
        if (instance != null)
        {
            //throw new System.Exception("You have more than 1 IconManager in the scene.");
            Destroy(this);
            return;
        }

        // Initialize the static class variables
        instance = this;

        DontDestroyOnLoad(gameObject);
    }
Ejemplo n.º 22
0
    void FixedUpdate()
    {
        if (!hasInitiated)
        {
            hasInitiated  = true;
            agent.enabled = true;
            agent.SetDestination(currentDestination.goalPosition);
            onNewDestination();
        }
        if (agent.pathPending)
        {
            return;
        }
        if (hasInitiated)
        {
            if (agent.remainingDistance < agent.stoppingDistance)
            {
                Destination dest = destMgr.nextDestination();

                if (dest == null)
                {
                    Instantiate(explosionPrefab, this.transform.position, Quaternion.identity);
                    arrowMgr.HideArrow();
                    pathShower.hidePath();
                    GameObject.Destroy(this.gameObject);
                }
                else
                {
                    IconManager.SetIcon(startDestination.gameObject, IconManager.LabelIcon.Purple);
                    IconManager.SetIcon(currentDestination.gameObject, IconManager.LabelIcon.Purple);
                    SpawnGhost();
                    startDestination   = currentDestination;
                    currentDestination = dest;
                    agent.SetDestination(dest.goalPosition);

                    onNewDestination();
                }
            }

            if (Time.time - lastTime > 1.0f)
            {
                lastTime = Time.time;
                Waypoint point = new Waypoint();
                point.goalPosition = transform.position;
                waypoints.Add(point);
            }

            pathShower.displayPath(agent.path);
        }
    }
Ejemplo n.º 23
0
        public static void AGXDynamicsForUnityLogoGUI()
        {
            GUILayout.BeginHorizontal(GUILayout.Width(570));
            GUILayout.Box(IconManager.GetAGXUnityLogo(),
                          GUI.Skin.customStyles[3],
                          GUILayout.Width(400),
                          GUILayout.Height(100));
            GUILayout.EndHorizontal();

            EditorGUILayout.LabelField("© " + System.DateTime.Now.Year + " Algoryx Simulation AB",
                                       InspectorEditor.Skin.LabelMiddleCenter);

            InspectorGUI.BrandSeparator(1, 6);
        }
Ejemplo n.º 24
0
        void DrawDocumentationButton(Rect p_rect, Type p_type)
        {
            DocumentationAttribute documentation = p_type.GetCustomAttribute <DocumentationAttribute>();

            if (documentation != null)
            {
                if (GUI.Button(new Rect(p_rect.x + 270, p_rect.y + 7, 16, 16),
                               IconManager.GetIcon("help_icon"), GUIStyle.none))
                {
                    Application.OpenURL(
                        "https://github.com/pshtif/Dash/blob/main/Documentation/" + documentation.url);
                }
            }
        }
Ejemplo n.º 25
0
 static int UnloadIcon(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         IconManager obj = (IconManager)ToLua.CheckObject <IconManager>(L, 1);
         obj.UnloadIcon();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 private void DisplayFileIconWithFileSize(string file, Actions caseDirectory)
 {
     try
     {
         BitmapSource icon = IconManager.GetLargeIcon(file, true, false);
         FilePreviewImage.Image = OsirtHelper.GetBitmap(icon);
         DisplayFileDetailsLabel(file, caseDirectory);
     }
     catch
     {
         FilePreviewImage.Image = null;
         SetFileLabelText("Unable to read file");
     }
 }
Ejemplo n.º 27
0
    // Use this for initialization
    void Start()
    {
        allIcons = GameObject.FindGameObjectWithTag("Global").GetComponent <IconManager>();

        ColorP1 = Defines.P1_ICON_COLOR;
        ColorP2 = Defines.P2_ICON_COLOR;

        if (NetworkManager.IsConnected())
        {
            spriteID_P1 = (Defines.ICONS)GameObject.Find("Global").GetComponent <GlobalScript>().iconP1;
            spriteID_P2 = (Defines.ICONS)GameObject.Find("Global").GetComponent <GlobalScript>().iconP2;
        }

        ResetVars();
    }
Ejemplo n.º 28
0
        private static void AddNetworkPreset()
        {
            DataLink[] dataLink = new DataLink[2];
            dataLink[0] = new DataLink();
            dataLink[1] = new DataLink();

            dataLink[0].DataIndex    = 0;
            dataLink[0].DataClassRef = DataManager.GetDataClassRef("Network Interface");

            dataLink[1].DataIndex    = 1;
            dataLink[1].DataClassRef = DataManager.GetDataClassRef("Network Interface");

            IconManager.AddIcon("Network", "{iconname}" + Environment.NewLine + Environment.NewLine + "{Network Interface#!0} - {Network Interface*!0}" + Environment.NewLine + "{Network Interface#!1} - {Network Interface*!1}", dataLink,
                                Globals.colorPresets[2].BackgroundColor, Globals.colorPresets[2].ForegroundColor);
        }
Ejemplo n.º 29
0
        public EventTypesNode(Snapin snapin, Catalogue catalogue)
            :       base(snapin)
        {
            // Properties

            DisplayName = Name;
            m_catalogue = catalogue;

            // Result images.

            AddResultImage(IconManager.GetResourceName(Icons.EventEnabled));
            AddResultImage(IconManager.GetResourceName(Icons.EventEnabled, IconMask.ReadOnly));
            AddResultImage(IconManager.GetResourceName(Icons.EventDisabled));
            AddResultImage(IconManager.GetResourceName(Icons.EventDisabled, IconMask.ReadOnly));
        }
Ejemplo n.º 30
0
        protected override async Task OnParametersSetAsync()
        {
            if (Source == null ||
                !Uri.TryCreate(Source, UriKind.RelativeOrAbsolute, out _sourceUri))
            {
                _sourceUri        = null;
                _sourceMarkup     = null;
                _isSourceResource = false;
                return;
            }

            // Check whether the source points to a resource
            _isSourceResource = _sourceUri.Scheme == "rsrc";
            _sourceMarkup     = _isSourceResource ? await IconManager.GetMarkupAsync(_sourceUri) : null;
        }
Ejemplo n.º 31
0
 static public void Init()
 {
     instance          = new IconManager();
     instance.itemData = DataManager.Instance.addData("IconData");
     UnityEngine.Object obj = Resources.Load("Icon/ICONDATA");
     if (obj)
     {
         string       dataAsYaml         = obj.ToString();
         Deserializer deserializer       = new Deserializer();
         Dictionary <string, string> dic = deserializer.Deserialize <Dictionary <string, string> >(new StringReader(dataAsYaml));
         foreach (var kv in dic)
         {
             instance.itemData.SetStringValue(kv.Key, kv.Value);
         }
     }
 }
Ejemplo n.º 32
0
    void FixedUpdate()
    {
        if (!hasInitialized)
        {
            hasInitialized = true;
            agent.enabled  = true;
            onNewDestination();
        }
        if (agent.pathPending || !hasInitialized)
        {
            return;
        }

        if (agent.remainingDistance < agent.stoppingDistance)
        {
            Destination dest = destMgr.nextDestination();

            if (dest == null)
            {
                sceneReloader.DoShowWinMenu(startTime);
                Explode();
            }
            else
            {
                currentDestination.hasReached = true;
                IconManager.SetIcon(startDestination.gameObject, IconManager.LabelIcon.Purple);
                IconManager.SetIcon(currentDestination.gameObject, IconManager.LabelIcon.Purple);
                SpawnGhost();
                startDestination   = currentDestination;
                currentDestination = dest;

                float pitch = 0.5f + (0.5f / (destMgr.destinations.Count - 2)) * (destMgr.destinationIndex - 1);
                sfxManager.Play(sfxManager.destinationReached, pitch);

                onNewDestination();
            }
        }

        if (Time.time - lastTime > 1.0f)
        {
            lastTime = Time.time;
            AddWaypoint(transform.position);
        }

        pathShower.displayPath(agent.path);
    }
Ejemplo n.º 33
0
 void Awake()
 {
     instance = this;
 }
Ejemplo n.º 34
0
 private void Start() {
     if (instance == null)
         instance = this;
 }