示例#1
0
    public void UnlockArtefact(int artefact)
    {
        Artefacts toUnlock = (Artefacts)artefact;

        switch (toUnlock)
        {
        case Artefacts.Butterdish:
            artefactsUnlocked[(int)Artefacts.Butterdish] = 1;
            break;

        case Artefacts.Ore:
            artefactsUnlocked[(int)Artefacts.Ore] = 1;
            break;

        case Artefacts.Knife:
            artefactsUnlocked[(int)Artefacts.Knife] = 1;
            break;

        case Artefacts.Lyre:
            artefactsUnlocked[(int)Artefacts.Lyre] = 1;
            break;

        case Artefacts.Textile:
            artefactsUnlocked[(int)Artefacts.Textile] = 1;
            break;

        default:
            Debug.LogWarning("Artefact does not exist to unlock!");
            break;
        }
    }
示例#2
0
        public object RegisterPageEntry(PDFLayoutContext context, string artefactType, IArtefactEntry entry)
        {
            IArtefactCollection col;

            if (!Artefacts.TryGetCollection(artefactType, out col))
            {
                col = context.DocumentLayout.CreateArtefactCollection(artefactType);
                _artefacts.Add(col);
            }
            return(col.Register(entry));
        }
		public static void Export(Artefacts artefacts, string target)
		{
			XmlSerializer xmlSerializer = new XmlSerializer(typeof(Artefacts));
			TextWriter textWriter = new StreamWriter(target);
			try
			{
				xmlSerializer.Serialize(textWriter, artefacts);
			}
			catch (Exception ex)
			{
				Logger.LogError(ex);
			}
			finally
			{
				textWriter.Close();
			}
		}
示例#4
0
    // Start is called before the first frame update
    void Start()
    {
        if (resourceName != "")
        {
            sprites = Resources.LoadAll <Sprite>(resourceName);

            if (currentSprite == -1)
            {
                currentSprite = Random.Range(0, sprites.Length);
            }
            else if (currentSprite >= sprites.Length)
            {
                currentSprite = sprites.Length - 1;
            }
            GetComponent <SpriteRenderer>().sprite = sprites[currentSprite];
            art = GetComponent <Artefacts>();
            art.currentArtefact = art.artefact[currentSprite];
        }
    }
    public void OnClick()
    {
        Player p = modele.getRoundOf();
        //for(int i = 0; i < 4; i++)
        // p.getCards().Add((TresorCard.TresorCardName.ClefFeu));
        bool haveTake = false;

        if (p.canAct())
        {
            Artefacts.ArtefactsName artefacts = p.getZone().getArtefacts();
            if (p.takeArtefact())
            {
                p.addAction();
                GameObject g = GameObject.Find(Artefacts.toString(artefacts));
                print("trouve " + g.name);
                Texture sprite = Resources.Load <Texture>(Artefacts.getSpritePath(artefacts));
                g.GetComponent <RawImage>().texture  = sprite;
                g.GetComponent <RawImage>().material = null;
            }
        }
    }
		public void Execute()
		{
			try
			{
				if (string.IsNullOrEmpty(m_sourceHive) ||
					string.IsNullOrEmpty(m_sourceRoot) ||
					string.IsNullOrEmpty(m_targetFile))
				{
					return;
				}

				Logger.LogInfo(
					string.Format("Execute the RegistryExportAction. Export Registry Hive [{0}] Root Key [{1}] to file [{2}]", m_sourceHive, m_sourceRoot, m_targetFile));

				if (File.Exists(m_targetFile))
				{
					Logger.LogInfo("Abort execution. The target file exist. Assume the RegistryExportAction has already executed successfully.");
					return;
				}

				List<ArtefactsArtefact> artifactCollection = GetRegistryArtefacts(m_sourceHive, m_sourceRoot);
				if (artifactCollection.Count == 0)
				{
					return;
				}

				Artefacts artefacts = new Artefacts();
				artefacts.Artefact = artifactCollection.ToArray();
				artefacts.Hive = m_sourceHive;
				artefacts.Root = m_sourceRoot;

				RegistryExportTranslater.Export(artefacts, m_targetFile);
			}
			catch (Exception ex)
			{
				Logger.LogError(ex);
			}
		}
示例#7
0
    void Awake()
    {
        //By defualt, show all tutorial hints.
        has_Dismissed_Tutorial = new bool[9];

        if (instance == null)
        {
            instance = this;
            GameObject temp = new GameObject();
            temp.name = "--Prefabs--";
            tiles     = new GameObject[7];
            Init();
            DontDestroyOnLoad(temp);
            for (int i = 0; i < 7; i++)
            {
                tiles[i].transform.parent = GameObject.Find("--Prefabs--").transform;
            }

            artefactsUnlocked = new int[5];
            artefactsUnlocked[(int)Artefacts.Butterdish] = PlayerPrefs.GetInt(Artefacts.Butterdish.ToString());
            artefactsUnlocked[(int)Artefacts.Ore]        = PlayerPrefs.GetInt(Artefacts.Ore.ToString());
            artefactsUnlocked[(int)Artefacts.Knife]      = PlayerPrefs.GetInt(Artefacts.Knife.ToString());
            artefactsUnlocked[(int)Artefacts.Lyre]       = PlayerPrefs.GetInt(Artefacts.Lyre.ToString());
            artefactsUnlocked[(int)Artefacts.Textile]    = PlayerPrefs.GetInt(Artefacts.Textile.ToString());

            transitionAnimator      = new GameObject();
            transitionAnimator.name = "Transition Animation";
            transitionAnimator.AddComponent <Animator>();
            transitionAnimator.GetComponent <Animator>().runtimeAnimatorController = Resources.Load <RuntimeAnimatorController>("Animations/TransitionStart");
            transitionAnimator.GetComponent <Animator>().speed = 1f;
            transitionAnimator.transform.localPosition         = Vector3.zero;


            transitionLeft                    = new GameObject();
            transitionLeft.name               = "TransitionLeft";
            transitionLeft.transform.parent   = transitionAnimator.transform;
            transitionCentre                  = new GameObject();
            transitionCentre.name             = "TransitionCentre";
            transitionCentre.transform.parent = transitionAnimator.transform;
            transitionRight                   = new GameObject();
            transitionRight.name              = "TransitionRight";
            transitionRight.transform.parent  = transitionAnimator.transform;

            transitionLeft.AddComponent <SpriteRenderer>();
            transitionLeft.GetComponent <SpriteRenderer>().sprite           = Resources.Load <Sprite>("Animations/TransitionLeft");
            transitionLeft.GetComponent <SpriteRenderer>().sortingOrder     = 0;
            transitionLeft.GetComponent <SpriteRenderer>().sortingLayerName = "Transition";
            transitionCentre.AddComponent <SpriteRenderer>();
            transitionCentre.GetComponent <SpriteRenderer>().sprite           = Resources.Load <Sprite>("Animations/TransitionCentre");
            transitionCentre.GetComponent <SpriteRenderer>().sortingOrder     = 1;
            transitionCentre.GetComponent <SpriteRenderer>().sortingLayerName = "Transition";
            transitionRight.AddComponent <SpriteRenderer>();
            transitionRight.GetComponent <SpriteRenderer>().sprite           = Resources.Load <Sprite>("Animations/TransitionRight");
            transitionRight.GetComponent <SpriteRenderer>().sortingOrder     = 0;
            transitionRight.GetComponent <SpriteRenderer>().sortingLayerName = "Transition";

            transitionAnimator.GetComponent <Animator>().updateMode = AnimatorUpdateMode.UnscaledTime;
            transitionAnimator.gameObject.SetActive(false);

            DontDestroyOnLoad(transitionAnimator);

            DontDestroyOnLoad(gameObject);

            currentLang      = PlayerPrefs.GetString("Lang", "Eng");
            tutorialComplete = PlayerPrefs.GetInt("Tutorial Complete", 0);
            currentArtefact  = Artefacts.Butterdish;
            //if (PlayerPrefs.GetString("Lang") != "Eng" || PlayerPrefs.GetString("Lang") != "Fr")
            //    currentLang = "Eng";
            //tutorialComplete = 1;
        }
        else if (instance != this)
        {//Destroys any new game managers that try to be created to keep it singleton.
            Destroy(gameObject);
        }
    }
示例#8
0
 public void SetCurrentArtefact(Artefacts newArtefact)
 {
     currentArtefact = newArtefact;
 }
示例#9
0
    // Update is called once per frame
    void Update()
    {
        if (zone.getEtat() != etat)  // ici je teste si on a un changement d'état, puis si c'est le cas, alors je change d'état, et je met à jour mon sprite
        {
            etat       = zone.getEtat();
            sprite     = Resources.Load <Sprite>(Etat.getSpritePath(etat));
            img        = GetComponent <Image>();
            img.sprite = sprite;
        }

        Artefacts.ArtefactsName a = zone.getArtefacts();
        if (a != Artefacts.ArtefactsName.None)
        {
            transform.GetChild(0).transform.GetComponent <Image>().sprite = Resources.Load <Sprite>(Artefacts.getSpritePath(a));
        }
        else
        {
            transform.GetChild(0).transform.GetComponent <Image>().enabled = false;
        }

        if (modele.getRoundOf().zonesSafeToMove().Contains(zone))
        {
            transform.GetChild(1).transform.GetComponent <Image>().enabled = true;
        }
        else
        {
            transform.GetChild(1).transform.GetComponent <Image>().enabled = false;
        }


        if (zone.isHeliport())
        {
            transform.GetChild(2).transform.GetComponent <Image>().enabled = true;
        }
        else
        {
            transform.GetChild(2).transform.GetComponent <Image>().enabled = false;
        }

        /*if (Input.GetMouseButtonDown(0))
         * { // finalement inutile grâce au boxcollider
         *  print("click");
         *  RaycastHit hit;
         *  Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
         *
         *  if (Physics.Raycast(ray, out hit))
         *  {
         *      if (hit.transform.name == "MyObjectName")
         *      {
         *          print("My object is clicked by mouse");
         *      }
         *  }
         * }*/
    }