This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class Done_BGScroller : MonoBehaviour | |
{ | |
public float scrollSpeed; | |
public float tileSizeZ; | |
private Vector3 startPosition; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.UI; | |
using UnityEngine.EventSystems; | |
using System.Collections; | |
public class DragPanel : MonoBehaviour, IPointerDownHandler, IDragHandler { | |
private Vector2 pointerOffset; | |
private RectTransform canvasRectTransform; | |
private RectTransform panelRectTransform; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.UI; | |
using System.Collections; | |
[RequireComponent(typeof(Text))] | |
public class Typer : MonoBehaviour { | |
public string msg = "Replace"; | |
public float startDelay = 2f; | |
public float typeDelay = 0.01f; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void CreateLineMesh(Vector3[] points) | |
{ | |
Mesh mesh = new Mesh(); | |
Vector2[] uvs = new Vector2[points.Length * 2]; | |
Vector3[] vertices = new Vector3[points.Length * 2]; | |
int[] triangles = new int[Mathf.RoundToInt(points.Length/4) * 2 * 3]; | |
for(int v = 0; v < vertices.Length; v += 2) | |
{ | |
vertices[v] = points[v/2] - Vector3.right * 0.05f; | |
uvs[v] = new Vector2(vertices[v].x, vertices[v].y); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2013 Calvin Rien | |
* | |
* Based on the JSON parser by Patrick van Bergen | |
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html | |
* | |
* Simplified it so that it doesn't throw exceptions | |
* and can be used in Unity iPhone with maximum code stripping. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class BarleyBrake : MonoBehaviour | |
{ | |
/// <summary> | |
/// Событие, которое произойдёт при победе | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define OUT | |
// Used for saving ViewPortLocation | |
FVector PlayerViewPointLocation; | |
// Used for saving ViewPortRotation | |
FRotator PlayerViewPointRotation; | |
void GetPlayerViewPort(){ | |
GetWorld()->GetFirstPlayerController()->GetPlayerViewPoint( | |
OUT PlayerViewPointLocation, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### Unreal Engine | |
## Default | |
Intermediate/ | |
Saved/ | |
Binaries/ | |
DerivedDataCache/ | |
## Extra | |
Content/StarterContent/HDRI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import StatType.StatType | |
object NewMain extends App{ | |
val one = new Person("sss") | |
val two = new Person("sas") with IHaveStats | |
two.requirements = Set(new Force(40),new Wind(40)) | |
two.requirements.foreach(obj => println(s"${obj.name} + ${obj.modifierType} + ${obj.value}")) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val str = "abAsdhqfdkjggjsjfpg".toList | |
val str1 = str | |
.groupBy(identity) // s -> List(s,s) | |
.mapValues(_.size) // s -> 2 | |
//.map( e => (e._1,e._2.length)) // s -> 2 | |
.toList // (s,2) | |
// with tail recursion | |
def timesFirst(chars: List[Char]) : List[(Char,Int)] = { | |
@tailrec // comiler cheks if really tailrecursive |
OlderNewer