Пример #1
0
    public Zapper CreateZapperAt(Vector3 position)
    {
        Zapper zapper = Zapper.Instantiate(this.zapperPrefab);

        zapper.transform.position = position;
        return(zapper);
    }
Пример #2
0
    public Zapper CreateZapperAt(Vector3 position)
    {
        Zapper zapper = Zapper.Instantiate(zapperPrefab);

        zapper.transform.position = position;
        zapper.gameObject.SetActive(true);
        return(zapper);
    }
Пример #3
0
 /// <summary>
 /// Initialize and clear the memory
 /// </summary>
 private void InitializeMemory()
 {
     Ram    = new byte[0x800];
     Map    = new Map(this, _engine);
     SRam   = new byte[0x2000];
     Zapper = new Zapper(_engine);
     Debug.WriteLine(this, "Memory initialized ok.", DebugStatus.Cool);
 }
Пример #4
0
        protected override void Initialize()
        {
            repository = new DbSetRepository(new DbContextProvider(() => new SampleMappingContext()));
            var z = new Zapper(repository);

            z.Zap();

            this.party1 = ObjectMother.Create <Party>();
            this.party2 = ObjectMother.Create <Party>();
            repository.Add(this.party1);
            repository.Add(this.party2);
            repository.Flush();
        }
Пример #5
0
        public Zapper ConfigureZapper(MouseState mouseState)
        {
            Zapper zapper = new Zapper();

            zapper.Trigger = () =>
            {
                return(mouseState.LeftButtonPressed);
            };

            zapper.LightSense = () =>
            {
                return(mouseState.SensePixel);
            };
            return(zapper);
        }
Пример #6
0
    public void OnEnterCamera()
    {
        int qt = Random.Range(0, zapperPlaceHolders.Length) + 1;

        for (int i = 0; i < qt; i++)
        {
            ZapperPlaceHolder placeholder = zapperPlaceHolders [Random.Range(0, zapperPlaceHolders.Length)];
            if (!placeholder.used)
            {
                placeholder.used = true;
                Zapper newZapper = ZapperManager.GetInstance().CreateZapperAt(placeholder.transform.position);
                this.zappers.Add(newZapper);
            }
        }
    }
Пример #7
0
    private void CreateZapper()
    {
        int zapperCount = Random.Range(0, (this.zapperPlaceHolders.Length + 1));


        this.cont++;
        for (int i = 0; i < zapperCount; i++)
        {
            int zapperIndex = Random.Range(0, this.zapperPlaceHolders.Length);
            ZapperPlaceHolder placeHolder = this.zapperPlaceHolders [zapperIndex];

            if (!placeHolder.wasUsed)
            {
                placeHolder.wasUsed = true;
                Vector3 placeHolderPosition = placeHolder.transform.position;
                Zapper  newZapper           = ZapperManager.GetIntance().CreateZapperAt(placeHolderPosition);
                zappers.Add(newZapper);
                //newZapper.transform.SetParent (this.transform, false);
            }
        }
    }
Пример #8
0
 public void MakeRoot(Zapper _zap)
 {
     isRoot = true;
     SetRoot(_zap);
     SetupLine(_zap.gameObject);
 }
Пример #9
0
 public void SetRoot(Zapper _zap)
 {
     root = _zap;
 }
Пример #10
0
 public void SetParent(ZapNode _node)
 {
     parent = _node;
     SetupLine(_node.gameObject);
     root = parent.root;
 }
Пример #11
0
 public static bool RemoveZap(Zapper _zap)
 {
     return(zaps.Remove(_zap));
 }
Пример #12
0
 public static void RegisterZap(Zapper _zap)
 {
     zaps.Add(_zap);
     _zap.id = nextZapperID++;
 }